diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:26:26 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:26:26 -0700 |
commit | 320b2313d19869333ed453af546e61a9fc2b81c9 (patch) | |
tree | 25f2eb8a0991ac485ca6354f0d3caf7fd775e732 /core/include/fxge | |
parent | 065e9321b84fc0490f3da9099e8840c65e06868d (diff) | |
download | pdfium-320b2313d19869333ed453af546e61a9fc2b81c9.tar.xz |
FX_BOOL considered harmful, part 2.
Fully automatic change, execpt for cleanup in fx_system.h
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1254703002 .
Diffstat (limited to 'core/include/fxge')
-rw-r--r-- | core/include/fxge/fpf.h | 4 | ||||
-rw-r--r-- | core/include/fxge/fx_dib.h | 118 | ||||
-rw-r--r-- | core/include/fxge/fx_font.h | 78 | ||||
-rw-r--r-- | core/include/fxge/fx_ge.h | 138 | ||||
-rw-r--r-- | core/include/fxge/fx_ge_apple.h | 8 | ||||
-rw-r--r-- | core/include/fxge/fx_ge_win32.h | 6 |
6 files changed, 176 insertions, 176 deletions
diff --git a/core/include/fxge/fpf.h b/core/include/fxge/fpf.h index fb9bf4d111..115ef55c49 100644 --- a/core/include/fxge/fpf.h +++ b/core/include/fxge/fpf.h @@ -41,8 +41,8 @@ public: virtual int32_t GetAscent() const = 0; virtual int32_t GetDescent() const = 0; - virtual FX_BOOL GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox) = 0; - virtual FX_BOOL GetBBox(FX_RECT &rtBBox) = 0; + virtual bool GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox) = 0; + virtual bool GetBBox(FX_RECT &rtBBox) = 0; virtual int32_t GetHeight() const = 0; virtual int32_t GetItalicAngle() const = 0; diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h index 27fc2f987d..554fe30602 100644 --- a/core/include/fxge/fx_dib.h +++ b/core/include/fxge/fx_dib.h @@ -179,13 +179,13 @@ public: virtual const uint8_t* GetScanline(int line) const = 0; - virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const + virtual bool SkipToScanline(int line, IFX_Pause* pPause) const { - return FALSE; + return false; } virtual void DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp, - int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const = 0; + int dest_width, bool bFlipX, int clip_left, int clip_width) const = 0; virtual void SetDownSampleSize(int width, int height) const {} @@ -194,24 +194,24 @@ public: return m_bpp; } - FX_BOOL IsAlphaMask() const + bool IsAlphaMask() const { return m_AlphaFlag == 1; } - FX_BOOL HasAlpha() const + bool HasAlpha() const { - return m_AlphaFlag & 2 ? TRUE : FALSE; + return m_AlphaFlag & 2 ? true : false; } - FX_BOOL IsOpaqueImage() const + bool IsOpaqueImage() const { return !(m_AlphaFlag & 3); } - FX_BOOL IsCmykImage() const + bool IsCmykImage() const { - return m_AlphaFlag & 4 ? TRUE : FALSE; + return m_AlphaFlag & 4 ? true : false; } @@ -248,11 +248,11 @@ public: CFX_DIBitmap* GetAlphaMask(const FX_RECT* pClip = NULL) const; - FX_BOOL CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip = NULL); + bool CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip = NULL); - CFX_DIBitmap* SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_RECT* pClip = NULL) const; + CFX_DIBitmap* SwapXY(bool bXFlip, bool bYFlip, const FX_RECT* pClip = NULL) const; - CFX_DIBitmap* FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const; + CFX_DIBitmap* FlipImage(bool bXFlip, bool bYFlip) const; void GetOverlapRect(int& dest_left, int& dest_top, int& width, int& height, int src_width, int src_height, int& src_left, int& src_top, const CFX_ClipRgn* pClipRgn); @@ -276,7 +276,7 @@ protected: void BuildPalette(); - FX_BOOL BuildAlphaMask(); + bool BuildAlphaMask(); int FindPalette(FX_DWORD color) const; @@ -292,9 +292,9 @@ public: CFX_DIBitmap(const CFX_DIBitmap& src); - FX_BOOL Create(int width, int height, FXDIB_Format format, uint8_t* pBuffer = NULL, int pitch = 0); + bool Create(int width, int height, FXDIB_Format format, uint8_t* pBuffer = NULL, int pitch = 0); - FX_BOOL Copy(const CFX_DIBSource* pSrc); + bool Copy(const CFX_DIBSource* pSrc); virtual uint8_t* GetBuffer() const { @@ -307,11 +307,11 @@ public: } virtual void DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp, - int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const; + int dest_width, bool bFlipX, int clip_left, int clip_width) const; void TakeOver(CFX_DIBitmap* pSrcBitmap); - FX_BOOL ConvertFormat(FXDIB_Format format, void* pIccTransform = NULL); + bool ConvertFormat(FXDIB_Format format, void* pIccTransform = NULL); void Clear(FX_DWORD color); @@ -319,40 +319,40 @@ public: void SetPixel(int x, int y, FX_DWORD color); - FX_BOOL LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel); + bool LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel); - FX_BOOL LoadChannel(FXDIB_Channel destChannel, int value); + bool LoadChannel(FXDIB_Channel destChannel, int value); - FX_BOOL MultiplyAlpha(int alpha); + bool MultiplyAlpha(int alpha); - FX_BOOL MultiplyAlpha(const CFX_DIBSource* pAlphaMask); + bool MultiplyAlpha(const CFX_DIBSource* pAlphaMask); - FX_BOOL TransferBitmap(int dest_left, int dest_top, int width, int height, + bool TransferBitmap(int dest_left, int dest_top, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform = NULL); - FX_BOOL CompositeBitmap(int dest_left, int dest_top, int width, int height, + bool CompositeBitmap(int dest_left, int dest_top, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, - int blend_type = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, FX_BOOL bRgbByteOrder = FALSE, void* pIccTransform = NULL); + int blend_type = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, bool bRgbByteOrder = false, void* pIccTransform = NULL); - FX_BOOL TransferMask(int dest_left, int dest_top, int width, int height, + bool 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 = 0, void* pIccTransform = NULL); - FX_BOOL CompositeMask(int dest_left, int dest_top, int width, int height, + bool 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 = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL); + int blend_type = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, bool bRgbByteOrder = false, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL CompositeRect(int dest_left, int dest_top, int width, int height, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL); + bool CompositeRect(int dest_left, int dest_top, int width, int height, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor); + bool ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor); - FX_BOOL DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect = NULL); + bool DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect = NULL); protected: uint8_t* m_pBuffer; - FX_BOOL m_bExtBuf; + bool m_bExtBuf; - FX_BOOL GetGrayData(void* pIccTransform = NULL); + bool GetGrayData(void* pIccTransform = NULL); }; class CFX_DIBExtractor { @@ -379,7 +379,7 @@ public: ~CFX_FilteredDIB(); - void LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc = FALSE); + void LoadSrc(const CFX_DIBSource* pSrc, bool bAutoDropSrc = false); virtual FXDIB_Format GetDestFormat() = 0; @@ -392,11 +392,11 @@ public: protected: virtual const uint8_t* GetScanline(int line) const; virtual void DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp, - int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const; + int dest_width, bool bFlipX, int clip_left, int clip_width) const; const CFX_DIBSource* m_pSrc; - FX_BOOL m_bAutoDropSrc; + bool m_bAutoDropSrc; uint8_t* m_pScanline; }; @@ -407,7 +407,7 @@ public: virtual void ComposeScanline(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha = NULL) = 0; - virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette) = 0; + virtual bool SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette) = 0; }; class CFX_ScanlineCompositor { @@ -416,8 +416,8 @@ public: ~CFX_ScanlineCompositor(); - FX_BOOL 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 = FALSE, int alpha_flag = 0, void* pIccTransform = NULL); + bool 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 = false, int alpha_flag = 0, void* pIccTransform = NULL); void CompositeRgbBitmapLine(uint8_t* dest_scan, const uint8_t* src_scan, int width, const uint8_t* clip_scan, @@ -449,7 +449,7 @@ protected: void* m_pIccTransform; uint8_t* m_pCacheScanline; int m_CacheSize; - FX_BOOL m_bRgbByteOrder; + bool m_bRgbByteOrder; }; class CFX_BitmapComposer : public IFX_ScanlineComposer { @@ -461,11 +461,11 @@ public: void Compose(CFX_DIBitmap* pDest, const CFX_ClipRgn* pClipRgn, int bitmap_alpha, - FX_DWORD mask_color, FX_RECT& dest_rect, FX_BOOL bVertical, - FX_BOOL bFlipX, FX_BOOL bFlipY, FX_BOOL bRgbByteOrder = FALSE, + FX_DWORD mask_color, FX_RECT& dest_rect, bool bVertical, + bool bFlipX, bool bFlipY, bool bRgbByteOrder = false, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); - virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette); + virtual bool SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette); virtual void ComposeScanline(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha); @@ -480,10 +480,10 @@ protected: FX_DWORD m_MaskColor; const CFX_DIBitmap* m_pClipMask; CFX_ScanlineCompositor m_Compositor; - FX_BOOL m_bVertical, m_bFlipX, m_bFlipY; + bool m_bVertical, m_bFlipX, m_bFlipY; int m_AlphaFlag; void* m_pIccTransform; - FX_BOOL m_bRgbByteOrder; + bool m_bRgbByteOrder; int m_BlendType; void ComposeScanlineV(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha = NULL); uint8_t* m_pScanlineV; @@ -501,7 +501,7 @@ public: virtual void ComposeScanline(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha); - virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette); + virtual bool SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette); CFX_DIBitmap* GetBitmap() { @@ -521,22 +521,22 @@ public: CFX_ImageStretcher(); ~CFX_ImageStretcher(); - FX_BOOL Start(IFX_ScanlineComposer* pDest, const CFX_DIBSource* pBitmap, + bool Start(IFX_ScanlineComposer* pDest, const CFX_DIBSource* pBitmap, int dest_width, int dest_height, const FX_RECT& bitmap_rect, FX_DWORD flags); - FX_BOOL Continue(IFX_Pause* pPause); - FX_BOOL StartQuickStretch(); - FX_BOOL StartStretch(); - FX_BOOL ContinueQuickStretch(IFX_Pause* pPause); - FX_BOOL ContinueStretch(IFX_Pause* pPause); + bool Continue(IFX_Pause* pPause); + bool StartQuickStretch(); + bool StartStretch(); + bool ContinueQuickStretch(IFX_Pause* pPause); + bool ContinueStretch(IFX_Pause* pPause); IFX_ScanlineComposer* m_pDest; const CFX_DIBSource* m_pSource; CStretchEngine* m_pStretchEngine; FX_DWORD m_Flags; - FX_BOOL m_bFlipX; - FX_BOOL m_bFlipY; + bool m_bFlipX; + bool m_bFlipY; int m_DestWidth; int m_DestHeight; FX_RECT m_ClipRect; @@ -552,10 +552,10 @@ public: CFX_ImageTransformer(); ~CFX_ImageTransformer(); - FX_BOOL Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pMatrix, + bool Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pMatrix, int flags, const FX_RECT* pClip); - FX_BOOL Continue(IFX_Pause* pPause); + bool Continue(IFX_Pause* pPause); CFX_AffineMatrix* m_pMatrix; FX_RECT m_StretchClip; @@ -575,14 +575,14 @@ public: CFX_ImageRenderer(); ~CFX_ImageRenderer(); - FX_BOOL Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn, + bool 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, FX_BOOL bRgbByteOrder = FALSE, + FX_DWORD dib_flags, bool bRgbByteOrder = false, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); - FX_BOOL Continue(IFX_Pause* pPause); + bool Continue(IFX_Pause* pPause); protected: CFX_DIBitmap* m_pDevice; @@ -598,7 +598,7 @@ protected: FX_DWORD m_Flags; int m_AlphaFlag; void* m_pIccTransform; - FX_BOOL m_bRgbByteOrder; + bool m_bRgbByteOrder; int m_BlendType; }; diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h index 2832fbfcbc..20ef5d42c2 100644 --- a/core/include/fxge/fx_font.h +++ b/core/include/fxge/fx_font.h @@ -56,12 +56,12 @@ public: CFX_Font(); ~CFX_Font(); - FX_BOOL LoadSubst(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags, - int weight, int italic_angle, int CharsetCP, FX_BOOL bVertical = FALSE); + bool LoadSubst(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags, + int weight, int italic_angle, int CharsetCP, bool bVertical = false); - FX_BOOL LoadEmbedded(const uint8_t* data, FX_DWORD size); + bool LoadEmbedded(const uint8_t* data, FX_DWORD size); - FX_BOOL LoadFile(IFX_FileRead* pFile); + bool LoadFile(IFX_FileRead* pFile); FXFT_Face GetFace() const { @@ -82,15 +82,15 @@ public: int GetDescent() const; - FX_BOOL GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox); + bool GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox); - FX_BOOL IsItalic(); + bool IsItalic(); - FX_BOOL IsBold(); + bool IsBold(); - FX_BOOL IsFixedWidth(); + bool IsFixedWidth(); - FX_BOOL IsVertical() const + bool IsVertical() const { return m_bVertical; } @@ -103,9 +103,9 @@ public: CFX_ByteString GetFaceName() const; - FX_BOOL IsTTFont(); + bool IsTTFont(); - FX_BOOL GetBBox(FX_RECT &bbox); + bool GetBBox(FX_RECT &bbox); int GetHeight(); @@ -118,7 +118,7 @@ public: FXFT_Face m_Face; CFX_SubstFont* m_pSubstFont; - FX_BOOL IsEmbedded() + bool IsEmbedded() { return m_bEmbedded; } @@ -133,14 +133,14 @@ public: void* m_pPlatformFont; void* m_pPlatformFontCollection; void* m_pDwFont; - FX_BOOL m_bDwLoaded; + bool m_bDwLoaded; void ReleasePlatformResource(); void DeleteFace(); protected: - FX_BOOL m_bEmbedded; - FX_BOOL m_bVertical; + bool m_bEmbedded; + bool m_bVertical; void* m_pOwnedStream; }; #define ENCODING_INTERNAL 0 @@ -182,11 +182,11 @@ public: int m_ItalicAngle; - FX_BOOL m_bSubstOfCJK; + bool m_bSubstOfCJK; int m_WeightCJK; - FX_BOOL m_bItlicCJK; + bool m_bItlicCJK; }; #define FX_FONT_FLAG_SERIF 0x01 #define FX_FONT_FLAG_FIXEDPITCH 0x02 @@ -206,9 +206,9 @@ public: ~CFX_FontMgr(); void InitFTLibrary(); FXFT_Face GetCachedFace(const CFX_ByteString& face_name, - int weight, FX_BOOL bItalic, uint8_t*& pFontData); + int weight, bool bItalic, uint8_t*& pFontData); FXFT_Face AddCachedFace(const CFX_ByteString& face_name, - int weight, FX_BOOL bItalic, uint8_t* pData, FX_DWORD size, int face_index); + int weight, bool bItalic, uint8_t* pData, FX_DWORD size, int face_index); FXFT_Face GetCachedTTCFace(int ttc_size, FX_DWORD checksum, int font_offset, uint8_t*& pFontData); FXFT_Face AddCachedTTCFace(int ttc_size, FX_DWORD checksum, @@ -217,12 +217,12 @@ public: FXFT_Face GetFixedFace(const uint8_t* pData, FX_DWORD size, int face_index); void ReleaseFace(FXFT_Face face); void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo); - FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags, + FXFT_Face FindSubstFont(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags, int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont); void FreeCache(); - FX_BOOL GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index); + bool GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index); CFX_FontMapper* m_pBuiltinMapper; IFX_FontMapper* m_pExtMapper; CFX_MapByteStringToPtr m_FaceMap; @@ -235,7 +235,7 @@ public: virtual ~IFX_FontMapper() {} - virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags, + virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags, int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont) = 0; CFX_FontMgr* m_pFontMgr; @@ -277,14 +277,14 @@ public: { return m_pFontEnumerator; } - virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags, + virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags, int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont); private: CFX_ByteString GetPSNameFromTT(void* hFont); CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_name); FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont, int iBaseFont, int italic_angle, int weight, int picthfamily); - FX_BOOL m_bListLoaded; + bool m_bListLoaded; FXFT_Face m_MMFaces[2]; CFX_ByteString m_LastFamily; CFX_DWordArray m_CharsetArray; @@ -299,12 +299,12 @@ public: static IFX_SystemFontInfo* CreateDefault(); virtual void Release() = 0; - virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) = 0; - virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* face, int& iExact) = 0; + virtual bool EnumFontList(CFX_FontMapper* pMapper) = 0; + virtual void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* face, int& iExact) = 0; virtual void* GetFont(const FX_CHAR* face) = 0; virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer, FX_DWORD size) = 0; - virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) = 0; - virtual FX_BOOL GetFontCharset(void* hFont, int& charset) = 0; + virtual bool GetFaceName(void* hFont, CFX_ByteString& name) = 0; + virtual bool GetFontCharset(void* hFont, int& charset) = 0; virtual int GetFaceIndex(void* hFont) { return 0; @@ -326,15 +326,15 @@ public: // IFX_SytemFontInfo: void Release() override; - FX_BOOL EnumFontList(CFX_FontMapper* pMapper) override; - void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, + bool EnumFontList(CFX_FontMapper* pMapper) override; + void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* face, int& bExact) override; void* GetFont(const FX_CHAR* face) override; FX_DWORD GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer, FX_DWORD size) override; void DeleteFont(void* hFont) override; - FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) override; - FX_BOOL GetFontCharset(void* hFont, int& charset) override; + bool GetFaceName(void* hFont, CFX_ByteString& name) override; + bool GetFontCharset(void* hFont, int& charset) override; protected: CFX_MapByteStringToPtr m_FontList; @@ -357,7 +357,7 @@ public: ~CFX_FontCache(); CFX_FaceCache* GetCachedFace(CFX_Font* pFont); void ReleaseCachedFace(CFX_Font* pFont); - void FreeCache(FX_BOOL bRelease = FALSE); + void FreeCache(bool bRelease = false); private: using CFX_FTCacheMap = std::map<FXFT_Face, CFX_CountedFaceCache*>; @@ -391,7 +391,7 @@ class CFX_FaceCache { public: ~CFX_FaceCache(); - const CFX_GlyphBitmap* LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle, const CFX_AffineMatrix* pMatrix, + const CFX_GlyphBitmap* LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, bool bFontStyle, const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias, int& text_flags); const CFX_PathData* LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph_index, int dest_width); @@ -399,12 +399,12 @@ public: CFX_FaceCache(FXFT_Face face); private: FXFT_Face m_Face; - CFX_GlyphBitmap* RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle, + CFX_GlyphBitmap* RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, bool bFontStyle, const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias); CFX_GlyphBitmap* RenderGlyph_Nativetext(CFX_Font* pFont, FX_DWORD glyph_index, const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias); CFX_GlyphBitmap* LookUpGlyphBitmap(CFX_Font* pFont, const CFX_AffineMatrix* pMatrix, CFX_ByteStringC& FaceGlyphsKey, - FX_DWORD glyph_index, FX_BOOL bFontStyle, int dest_width, int anti_alias); + FX_DWORD glyph_index, bool bFontStyle, int dest_width, int anti_alias); CFX_MapByteStringToPtr m_SizeMap; CFX_MapPtrToPtr m_PathMap; CFX_DIBitmap* m_pBitmap; @@ -418,16 +418,16 @@ typedef struct { FX_FLOAT m_fOriginX, m_fOriginY; } FXTEXT_GLYPHPOS; FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_alias, FX_FLOAT retinaScaleX = 1.0f, FX_FLOAT retinaScaleY = 1.0f); -FX_BOOL OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size, +bool OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size, CFX_AffineMatrix* pMatrix, unsigned long glyph_index, unsigned long argb); -FX_BOOL OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size, +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); class IFX_GSUBTable { public: static IFX_GSUBTable* Create(CFX_Font* pFont); virtual ~IFX_GSUBTable() { } - virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0; + virtual bool GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0; }; #endif // CORE_INCLUDE_FXGE_FX_FONT_H_ diff --git a/core/include/fxge/fx_ge.h b/core/include/fxge/fx_ge.h index fd9c148b62..5965641a3e 100644 --- a/core/include/fxge/fx_ge.h +++ b/core/include/fxge/fx_ge.h @@ -193,11 +193,11 @@ public: void Transform(const CFX_AffineMatrix* pMatrix); - FX_BOOL IsRect() const; + bool IsRect() const; - FX_BOOL GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, FX_BOOL&bThin, FX_BOOL bAdjust) const; + bool GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, bool&bThin, bool bAdjust) const; - FX_BOOL IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* rect) const; + bool IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* rect) const; void Append(const CFX_PathData* pSrc, const CFX_AffineMatrix* pMatrix); void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top); @@ -294,10 +294,10 @@ typedef struct { FX_DWORD m_GlyphIndex; FX_FLOAT m_OriginX, m_OriginY; int m_FontCharWidth; - FX_BOOL m_bGlyphAdjust; + bool m_bGlyphAdjust; FX_FLOAT m_AdjustMatrix[4]; FX_DWORD m_ExtGID; - FX_BOOL m_bFontStyle; + bool m_bFontStyle; } FXTEXT_CHARPOS; class CFX_RenderDevice { @@ -313,7 +313,7 @@ public: return m_pDeviceDriver; } - FX_BOOL StartRendering(); + bool StartRendering(); void EndRendering(); @@ -321,7 +321,7 @@ public: void SaveState(); - void RestoreState(FX_BOOL bKeepSaved = FALSE); + void RestoreState(bool bKeepSaved = false); @@ -365,26 +365,26 @@ public: m_pBitmap = pBitmap; } - FX_BOOL CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const; + bool CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const; const FX_RECT& GetClipBox() const { return m_ClipBox; } - FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, + bool SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, int fill_mode ); - FX_BOOL SetClip_Rect(const FX_RECT* pRect); + bool SetClip_Rect(const FX_RECT* pRect); - FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, + bool SetClip_PathStroke(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState ); - FX_BOOL DrawPath(const CFX_PathData* pPathData, + bool DrawPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState, FX_DWORD fill_color, @@ -395,46 +395,46 @@ public: int blend_type = FXDIB_BLEND_NORMAL ); - FX_BOOL SetPixel(int x, int y, FX_DWORD color, + bool SetPixel(int x, int y, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD color, + bool FillRect(const FX_RECT* pRect, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); - FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, + bool DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, int fill_mode = 0, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); - FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL); + bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL); CFX_DIBitmap* GetBackDrop(); - FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_type = FXDIB_BLEND_NORMAL, + bool SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_type = FXDIB_BLEND_NORMAL, void* pIccTransform = NULL); - FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height, + bool StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height, FX_DWORD flags = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); - FX_BOOL SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD color, + bool SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height, + bool StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height, FX_DWORD color, FX_DWORD flags = 0, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, + 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); - FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause); + bool ContinueDIBits(void* handle, IFX_Pause* pPause); void CancelDIBits(void* handle); - FX_BOOL DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos, + bool 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, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos, + bool 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, @@ -477,12 +477,12 @@ public: ~CFX_FxgeDevice(); - FX_BOOL Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, FX_BOOL bRgbByteOrder = FALSE, CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE); + bool Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, bool bRgbByteOrder = false, CFX_DIBitmap* pOriDevice = NULL, bool bGroupKnockout = false); - FX_BOOL Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL); + bool Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL); protected: - FX_BOOL m_bOwnedBitmap; + bool m_bOwnedBitmap; }; class CFX_SkiaDevice : public CFX_RenderDevice { @@ -492,19 +492,19 @@ public: ~CFX_SkiaDevice(); - FX_BOOL Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, FX_BOOL bRgbByteOrder = FALSE, CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE); + bool Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, bool bRgbByteOrder = false, CFX_DIBitmap* pOriDevice = NULL, bool bGroupKnockout = false); - FX_BOOL Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL); + bool Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL); protected: - FX_BOOL m_bOwnedBitmap; + bool m_bOwnedBitmap; }; class IFX_RenderDeviceDriver { public: - static IFX_RenderDeviceDriver* CreateFxgeDriver(CFX_DIBitmap* pBitmap, FX_BOOL bRgbByteOrder = FALSE, - CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE); + static IFX_RenderDeviceDriver* CreateFxgeDriver(CFX_DIBitmap* pBitmap, bool bRgbByteOrder = false, + CFX_DIBitmap* pOriDevice = NULL, bool bGroupKnockout = false); virtual ~IFX_RenderDeviceDriver() {} virtual void Begin() { } @@ -517,14 +517,14 @@ public: return CFX_Matrix(); } - virtual FX_BOOL IsPSPrintDriver() + virtual bool IsPSPrintDriver() { - return FALSE; + return false; } - virtual FX_BOOL StartRendering() + virtual bool StartRendering() { - return TRUE; + return true; } virtual void EndRendering() {} @@ -534,23 +534,23 @@ public: virtual void SaveState() = 0; - virtual void RestoreState(FX_BOOL bKeepSaved = FALSE) = 0; + virtual void RestoreState(bool bKeepSaved = false) = 0; - virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, + virtual bool SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, int fill_mode ) = 0; - virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, + virtual bool SetClip_PathStroke(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState ) { - return FALSE; + return false; } - virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, + virtual bool DrawPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState, FX_DWORD fill_color, @@ -561,59 +561,59 @@ public: int blend_type = FXDIB_BLEND_NORMAL ) = 0; - virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color, + virtual bool SetPixel(int x, int y, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL) { - return FALSE; + return false; } - virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color, + virtual bool FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) { - return FALSE; + return false; } - virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, + virtual bool DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) { - return FALSE; + return false; } - virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0; + virtual bool GetClipBox(FX_RECT* pRect) = 0; - virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE) + virtual bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, bool bDEdge = false) { - return FALSE; + return false; } virtual CFX_DIBitmap* GetBackDrop() { return NULL; } - virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, + virtual bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int dest_left, int dest_top, int blend_type, int alpha_flag = 0, void* pIccTransform = NULL) = 0; - virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, + virtual bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) = 0; - virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, + virtual bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, const CFX_AffineMatrix* pMatrix, FX_DWORD flags, void*& handle, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) = 0; - virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) + virtual bool ContinueDIBits(void* handle, IFX_Pause* pPause) { - return FALSE; + return false; } virtual void CancelDIBits(void* handle) {} - virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, + virtual bool DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL) { - return FALSE; + return false; } virtual void* GetPlatformSurface() @@ -646,13 +646,13 @@ public: ~CFX_PSRenderer(); - void Init(IFX_PSOutput* pOutput, int ps_level, int width, int height, FX_BOOL bCmykOutput); - FX_BOOL StartRendering(); + void Init(IFX_PSOutput* pOutput, int ps_level, int width, int height, bool bCmykOutput); + bool StartRendering(); void EndRendering(); void SaveState(); - void RestoreState(FX_BOOL bKeepSaved = FALSE); + void RestoreState(bool bKeepSaved = false); void SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, @@ -669,7 +669,7 @@ public: return m_ClipBox; } - FX_BOOL DrawPath(const CFX_PathData* pPathData, + bool DrawPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState, FX_DWORD fill_color, @@ -679,18 +679,18 @@ public: void* pIccTransform = NULL ); - FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, + bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, + bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, int dest_width, int dest_height, FX_DWORD flags, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL DrawDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, + bool DrawDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const CFX_AffineMatrix* pMatrix, FX_DWORD flags, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache, + bool 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 = 0, void* pIccTransform = NULL); private: @@ -701,11 +701,11 @@ private: CFX_GraphStateData m_CurGraphState; - FX_BOOL m_bGraphStateSet; + bool m_bGraphStateSet; - FX_BOOL m_bCmykOutput; + bool m_bCmykOutput; - FX_BOOL m_bColorSet; + bool m_bColorSet; FX_DWORD m_LastColor; @@ -714,7 +714,7 @@ private: CFX_ArrayTemplate<CPSFont*> m_PSFontList; CFX_ArrayTemplate<FX_RECT> m_ClipBoxStack; - FX_BOOL m_bInited; + bool m_bInited; void OutputPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device); diff --git a/core/include/fxge/fx_ge_apple.h b/core/include/fxge/fx_ge_apple.h index 0fb8bedcfc..ebe61cc59f 100644 --- a/core/include/fxge/fx_ge_apple.h +++ b/core/include/fxge/fx_ge_apple.h @@ -13,15 +13,15 @@ class CFX_QuartzDevice : public CFX_RenderDevice public: CFX_QuartzDevice(); ~CFX_QuartzDevice(); - FX_BOOL Attach(CGContextRef context, int32_t nDeviceClass = FXDC_DISPLAY); - FX_BOOL Attach(CFX_DIBitmap* pBitmap); - FX_BOOL Create(int32_t width, int32_t height, FXDIB_Format format); + bool Attach(CGContextRef context, int32_t nDeviceClass = FXDC_DISPLAY); + bool Attach(CFX_DIBitmap* pBitmap); + bool Create(int32_t width, int32_t height, FXDIB_Format format); CGContextRef GetContext(); protected: CGContextRef m_pContext; - FX_BOOL m_bOwnedBitmap; + bool m_bOwnedBitmap; }; #endif diff --git a/core/include/fxge/fx_ge_win32.h b/core/include/fxge/fx_ge_win32.h index 5b16146b6a..8023bd8099 100644 --- a/core/include/fxge/fx_ge_win32.h +++ b/core/include/fxge/fx_ge_win32.h @@ -72,13 +72,13 @@ protected: class CFX_WindowsDevice : public CFX_RenderDevice { public: - static IFX_RenderDeviceDriver* CreateDriver(HDC hDC, FX_BOOL bCmykOutput = FALSE); + static IFX_RenderDeviceDriver* CreateDriver(HDC hDC, bool bCmykOutput = false); - CFX_WindowsDevice(HDC hDC, FX_BOOL bCmykOutput = FALSE, FX_BOOL bForcePSOutput = FALSE, int psLevel = 2); + CFX_WindowsDevice(HDC hDC, bool bCmykOutput = false, bool bForcePSOutput = false, int psLevel = 2); HDC GetDC() const; - FX_BOOL m_bForcePSOutput; + bool m_bForcePSOutput; static int m_psLevel; }; |