diff options
Diffstat (limited to 'core/fxge')
32 files changed, 519 insertions, 519 deletions
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp index cd72865421..8bda709c26 100644 --- a/core/fxge/agg/fx_agg_driver.cpp +++ b/core/fxge/agg/fx_agg_driver.cpp @@ -233,7 +233,7 @@ FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars, CFX_FontCache* pCache, const CFX_Matrix* pObject2Device, FX_FLOAT font_size, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform) { return FALSE; @@ -384,7 +384,7 @@ FX_BOOL CFX_AggDeviceDriver::SetClip_PathStroke( class CFX_Renderer { private: int m_Alpha, m_Red, m_Green, m_Blue, m_Gray; - FX_DWORD m_Color; + uint32_t m_Color; FX_BOOL m_bFullCover; FX_BOOL m_bRgbByteOrder; CFX_DIBitmap* m_pOriDevice; @@ -746,7 +746,7 @@ class CFX_Renderer { } if (src_alpha) { if (src_alpha == 255) { - *(FX_DWORD*)dest_scan = m_Color; + *(uint32_t*)dest_scan = m_Color; } else { uint8_t dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255; @@ -782,7 +782,7 @@ class CFX_Renderer { } if (src_alpha) { if (src_alpha == 255) { - *(FX_DWORD*)dest_scan = m_Color; + *(uint32_t*)dest_scan = m_Color; } else { if (dest_scan[3] == 0) { dest_scan[3] = src_alpha; @@ -834,7 +834,7 @@ class CFX_Renderer { if (src_alpha) { if (src_alpha == 255) { if (Bpp == 4) { - *(FX_DWORD*)dest_scan = m_Color; + *(uint32_t*)dest_scan = m_Color; } else if (Bpp == 3) { *dest_scan++ = m_Red; *dest_scan++ = m_Green; @@ -914,7 +914,7 @@ class CFX_Renderer { if (src_alpha) { if (src_alpha == 255) { if (Bpp == 4) { - *(FX_DWORD*)dest_scan = m_Color; + *(uint32_t*)dest_scan = m_Color; } else if (Bpp == 3) { *dest_scan++ = m_Blue; *dest_scan++ = m_Green; @@ -1081,7 +1081,7 @@ class CFX_Renderer { FX_BOOL Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, - FX_DWORD color, + uint32_t color, FX_BOOL bFullCover, FX_BOOL bRgbByteOrder, int alpha_flag = 0, @@ -1211,7 +1211,7 @@ class CFX_Renderer { FX_BOOL CFX_AggDeviceDriver::RenderRasterizer( agg::rasterizer_scanline_aa& rasterizer, - FX_DWORD color, + uint32_t color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout, int alpha_flag, @@ -1231,8 +1231,8 @@ FX_BOOL CFX_AggDeviceDriver::RenderRasterizer( FX_BOOL CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState, - FX_DWORD fill_color, - FX_DWORD stroke_color, + uint32_t fill_color, + uint32_t stroke_color, int fill_mode, int alpha_flag, void* pIccTransform, @@ -1312,7 +1312,7 @@ FX_BOOL CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData, return TRUE; } -void RgbByteOrderSetPixel(CFX_DIBitmap* pBitmap, int x, int y, FX_DWORD argb) { +void RgbByteOrderSetPixel(CFX_DIBitmap* pBitmap, int x, int y, uint32_t argb) { if (x < 0 || x >= pBitmap->GetWidth() || y < 0 || y >= pBitmap->GetHeight()) { return; } @@ -1351,7 +1351,7 @@ void RgbByteOrderCompositeRect(CFX_DIBitmap* pBitmap, uint8_t* dest_scan = pBuffer + row * pBitmap->GetPitch() + rect.left * Bpp; if (Bpp == 4) { - FX_DWORD* scan = (FX_DWORD*)dest_scan; + uint32_t* scan = (uint32_t*)dest_scan; for (int col = 0; col < width; col++) { *scan++ = dib_argb; } @@ -1523,7 +1523,7 @@ FX_ARGB _DefaultCMYK2ARGB(FX_CMYK cmyk, uint8_t alpha) { FX_BOOL _DibSetPixel(CFX_DIBitmap* pDevice, int x, int y, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform) { FX_BOOL bObjCMYK = FXGETFLAG_COLORTYPE(alpha_flag); @@ -1558,7 +1558,7 @@ FX_BOOL _DibSetPixel(CFX_DIBitmap* pDevice, FX_BOOL CFX_AggDeviceDriver::SetPixel(int x, int y, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform) { if (!m_pBitmap->GetBuffer()) { @@ -1604,7 +1604,7 @@ FX_BOOL CFX_AggDeviceDriver::SetPixel(int x, } FX_BOOL CFX_AggDeviceDriver::FillRect(const FX_RECT* pRect, - FX_DWORD fill_color, + uint32_t fill_color, int alpha_flag, void* pIccTransform, int blend_type) { @@ -1704,7 +1704,7 @@ FX_BOOL CFX_AggDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, } FX_BOOL CFX_AggDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD argb, + uint32_t argb, const FX_RECT* pSrcRect, int left, int top, @@ -1725,13 +1725,13 @@ FX_BOOL CFX_AggDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, } FX_BOOL CFX_AggDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, - FX_DWORD argb, + uint32_t argb, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, - FX_DWORD flags, + uint32_t flags, int alpha_flag, void* pIccTransform, int blend_type) { @@ -1764,9 +1764,9 @@ FX_BOOL CFX_AggDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_BOOL CFX_AggDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, - FX_DWORD argb, + uint32_t argb, const CFX_Matrix* pMatrix, - FX_DWORD render_flags, + uint32_t render_flags, void*& handle, int alpha_flag, void* pIccTransform, diff --git a/core/fxge/agg/fx_agg_driver.h b/core/fxge/agg/fx_agg_driver.h index 2b6b6683f6..5bc9283b03 100644 --- a/core/fxge/agg/fx_agg_driver.h +++ b/core/fxge/agg/fx_agg_driver.h @@ -50,19 +50,19 @@ class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver { FX_BOOL DrawPath(const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState, - FX_DWORD fill_color, - FX_DWORD stroke_color, + uint32_t fill_color, + uint32_t stroke_color, int fill_mode, int alpha_flag, void* pIccTransform, int blend_type) override; FX_BOOL SetPixel(int x, int y, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform) override; FX_BOOL FillRect(const FX_RECT* pRect, - FX_DWORD fill_color, + uint32_t fill_color, int alpha_flag, void* pIccTransform, int blend_type) override; @@ -70,7 +70,7 @@ class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver { FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform, int blend_type) override { @@ -84,7 +84,7 @@ class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver { FX_BOOL bDEdge = FALSE) override; CFX_DIBitmap* GetBackDrop() override { return m_pOriDevice; } FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD color, + uint32_t color, const FX_RECT* pSrcRect, int left, int top, @@ -92,21 +92,21 @@ class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver { int alpha_flag, void* pIccTransform) override; FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD color, + uint32_t color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, - FX_DWORD flags, + uint32_t flags, int alpha_flag, void* pIccTransform, int blend_type) override; FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, - FX_DWORD color, + uint32_t color, const CFX_Matrix* pMatrix, - FX_DWORD flags, + uint32_t flags, void*& handle, int alpha_flag, void* pIccTransform, @@ -119,13 +119,13 @@ class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver { CFX_FontCache* pCache, const CFX_Matrix* pObject2Device, FX_FLOAT font_size, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform) override; int GetDriverType() const override { return 1; } FX_BOOL RenderRasterizer(agg::rasterizer_scanline_aa& rasterizer, - FX_DWORD color, + uint32_t color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout, int alpha_flag, diff --git a/core/fxge/android/fpf_skiafont.cpp b/core/fxge/android/fpf_skiafont.cpp index 58b937f3d4..bd9b549e99 100644 --- a/core/fxge/android/fpf_skiafont.cpp +++ b/core/fxge/android/fpf_skiafont.cpp @@ -167,9 +167,9 @@ int32_t CFPF_SkiaFont::GetItalicAngle() const { } return 0; } -FX_DWORD CFPF_SkiaFont::GetFontData(FX_DWORD dwTable, +uint32_t CFPF_SkiaFont::GetFontData(uint32_t dwTable, uint8_t* pBuffer, - FX_DWORD dwSize) { + uint32_t dwSize) { if (!m_Face) { return 0; } @@ -177,12 +177,12 @@ FX_DWORD CFPF_SkiaFont::GetFontData(FX_DWORD dwTable, if (FXFT_Load_Sfnt_Table(m_Face, dwTable, 0, pBuffer, &ulSize)) { return 0; } - return pdfium::base::checked_cast<FX_DWORD>(ulSize); + return pdfium::base::checked_cast<uint32_t>(ulSize); } FX_BOOL CFPF_SkiaFont::InitFont(CFPF_SkiaFontMgr* pFontMgr, CFPF_SkiaFontDescriptor* pFontDes, const CFX_ByteStringC& bsFamily, - FX_DWORD dwStyle, + uint32_t dwStyle, uint8_t uCharset) { if (!pFontMgr || !pFontDes) { return FALSE; diff --git a/core/fxge/android/fpf_skiafont.h b/core/fxge/android/fpf_skiafont.h index d077f38606..9e35c942d3 100644 --- a/core/fxge/android/fpf_skiafont.h +++ b/core/fxge/android/fpf_skiafont.h @@ -27,7 +27,7 @@ class CFPF_SkiaFont : public IFPF_Font { FPF_HFONT GetHandle() override; CFX_ByteString GetFamilyName() override; CFX_WideString GetPsName() override; - FX_DWORD GetFontStyle() const override { return m_dwStyle; } + uint32_t GetFontStyle() const override { return m_dwStyle; } uint8_t GetCharset() const override { return m_uCharset; } int32_t GetGlyphIndex(FX_WCHAR wUnicode) override; int32_t GetGlyphWidth(int32_t iGlyphIndex) override; @@ -37,23 +37,23 @@ class CFPF_SkiaFont : public IFPF_Font { FX_BOOL GetBBox(FX_RECT& rtBBox) override; int32_t GetHeight() const override; int32_t GetItalicAngle() const override; - FX_DWORD GetFontData(FX_DWORD dwTable, + uint32_t GetFontData(uint32_t dwTable, uint8_t* pBuffer, - FX_DWORD dwSize) override; + uint32_t dwSize) override; FX_BOOL InitFont(CFPF_SkiaFontMgr* pFontMgr, CFPF_SkiaFontDescriptor* pFontDes, const CFX_ByteStringC& bsFamily, - FX_DWORD dwStyle, + uint32_t dwStyle, uint8_t uCharset); protected: CFPF_SkiaFontMgr* m_pFontMgr; CFPF_SkiaFontDescriptor* m_pFontDes; FXFT_Face m_Face; - FX_DWORD m_dwStyle; + uint32_t m_dwStyle; uint8_t m_uCharset; - FX_DWORD m_dwRefCount; + uint32_t m_dwRefCount; }; #endif diff --git a/core/fxge/android/fpf_skiafontmgr.cpp b/core/fxge/android/fpf_skiafontmgr.cpp index 13d030cf26..c9748da859 100644 --- a/core/fxge/android/fpf_skiafontmgr.cpp +++ b/core/fxge/android/fpf_skiafontmgr.cpp @@ -42,8 +42,8 @@ static void FPF_SkiaStream_Close(FXFT_Stream stream) {} }; #endif struct FPF_SKIAFONTMAP { - FX_DWORD dwFamily; - FX_DWORD dwSubSt; + uint32_t dwFamily; + uint32_t dwSubSt; }; static const FPF_SKIAFONTMAP g_SkiaFontmap[] = { {0x58c5083, 0xc8d2e345}, {0x5dfade2, 0xe1633081}, @@ -58,7 +58,7 @@ static const FPF_SKIAFONTMAP g_SkiaFontmap[] = { {0xcad5eaf6, 0x59b9f8f1}, {0xcb7a04c8, 0xc8d2e345}, {0xfb4ce0de, 0xe1633081}, }; -FX_DWORD FPF_SkiaGetSubstFont(FX_DWORD dwHash) { +uint32_t FPF_SkiaGetSubstFont(uint32_t dwHash) { int32_t iStart = 0; int32_t iEnd = sizeof(g_SkiaFontmap) / sizeof(FPF_SKIAFONTMAP); while (iStart <= iEnd) { @@ -79,7 +79,7 @@ static const FPF_SKIAFONTMAP g_SkiaSansFontMap[] = { {0x779ce19d, 0xd5b8d10f}, {0xcb7a04c8, 0xd5b8d10f}, {0xfb4ce0de, 0xd5b8d10f}, }; -FX_DWORD FPF_SkiaGetSansFont(FX_DWORD dwHash) { +uint32_t FPF_SkiaGetSansFont(uint32_t dwHash) { int32_t iStart = 0; int32_t iEnd = sizeof(g_SkiaSansFontMap) / sizeof(FPF_SKIAFONTMAP); while (iStart <= iEnd) { @@ -138,7 +138,7 @@ enum FPF_SKIACHARSET { FPF_SKIACHARSET_PC = 1 << 17, FPF_SKIACHARSET_OEM = 1 << 18, }; -static FX_DWORD FPF_SkiaGetCharset(uint8_t uCharset) { +static uint32_t FPF_SkiaGetCharset(uint8_t uCharset) { switch (uCharset) { case FXFONT_ANSI_CHARSET: return FPF_SKIACHARSET_Ansi; @@ -173,8 +173,8 @@ static FX_DWORD FPF_SkiaGetCharset(uint8_t uCharset) { } return FPF_SKIACHARSET_Default; } -static FX_DWORD FPF_SKIANormalizeFontName(const CFX_ByteStringC& bsfamily) { - FX_DWORD dwHash = 0; +static uint32_t FPF_SKIANormalizeFontName(const CFX_ByteStringC& bsfamily) { + uint32_t dwHash = 0; int32_t iLength = bsfamily.GetLength(); const FX_CHAR* pBuffer = bsfamily.GetCStr(); for (int32_t i = 0; i < iLength; i++) { @@ -186,8 +186,8 @@ static FX_DWORD FPF_SKIANormalizeFontName(const CFX_ByteStringC& bsfamily) { } return dwHash; } -static FX_DWORD FPF_SKIAGetFamilyHash(const CFX_ByteStringC& bsFamily, - FX_DWORD dwStyle, +static uint32_t FPF_SKIAGetFamilyHash(const CFX_ByteStringC& bsFamily, + uint32_t dwStyle, uint8_t uCharset) { CFX_ByteString bsFont(bsFamily); if (dwStyle & FXFONT_BOLD) { @@ -252,16 +252,16 @@ void CFPF_SkiaFontMgr::LoadPrivateFont(const CFX_ByteStringC& bsFileName) {} void CFPF_SkiaFontMgr::LoadPrivateFont(void* pBuffer, size_t szBuffer) {} IFPF_Font* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname, uint8_t uCharset, - FX_DWORD dwStyle, - FX_DWORD dwMatch) { - FX_DWORD dwHash = FPF_SKIAGetFamilyHash(bsFamilyname, dwStyle, uCharset); + uint32_t dwStyle, + uint32_t dwMatch) { + uint32_t dwHash = FPF_SKIAGetFamilyHash(bsFamilyname, dwStyle, uCharset); auto it = m_FamilyFonts.find(dwHash); if (it != m_FamilyFonts.end() && it->second) return it->second->Retain(); - FX_DWORD dwFaceName = FPF_SKIANormalizeFontName(bsFamilyname); - FX_DWORD dwSubst = FPF_SkiaGetSubstFont(dwFaceName); - FX_DWORD dwSubstSans = FPF_SkiaGetSansFont(dwFaceName); + uint32_t dwFaceName = FPF_SKIANormalizeFontName(bsFamilyname); + uint32_t dwSubst = FPF_SkiaGetSubstFont(dwFaceName); + uint32_t dwSubstSans = FPF_SkiaGetSansFont(dwFaceName); FX_BOOL bMaybeSymbol = FPF_SkiaMaybeSymbol(bsFamilyname); if (uCharset != FXFONT_ARABIC_CHARSET && FPF_SkiaMaybeArabic(bsFamilyname)) { uCharset = FXFONT_ARABIC_CHARSET; @@ -280,7 +280,7 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname, continue; } int32_t nFind = 0; - FX_DWORD dwSysFontName = FPF_SKIANormalizeFontName(pFontDes->m_pFamily); + uint32_t dwSysFontName = FPF_SKIANormalizeFontName(pFontDes->m_pFamily); if (dwFaceName == dwSysFontName) { nFind += FPF_SKIAMATCHWEIGHT_NAME1; } @@ -440,7 +440,7 @@ void CFPF_SkiaFontMgr::ScanFile(const CFX_ByteStringC& file) { FXFT_Done_Face(face); } } -static const FX_DWORD g_FPFSkiaFontCharsets[] = { +static const uint32_t g_FPFSkiaFontCharsets[] = { FPF_SKIACHARSET_Ansi, FPF_SKIACHARSET_EeasternEuropean, FPF_SKIACHARSET_Cyrillic, @@ -474,8 +474,8 @@ static const FX_DWORD g_FPFSkiaFontCharsets[] = { FPF_SKIACHARSET_OEM, FPF_SKIACHARSET_Symbol, }; -static FX_DWORD FPF_SkiaGetFaceCharset(TT_OS2* pOS2) { - FX_DWORD dwCharset = 0; +static uint32_t FPF_SkiaGetFaceCharset(TT_OS2* pOS2) { + uint32_t dwCharset = 0; if (pOS2) { for (int32_t i = 0; i < 32; i++) { if (pOS2->ulCodePageRange1 & (1 << i)) { diff --git a/core/fxge/android/fpf_skiafontmgr.h b/core/fxge/android/fpf_skiafontmgr.h index 5ba5b16475..5ed409cccc 100644 --- a/core/fxge/android/fpf_skiafontmgr.h +++ b/core/fxge/android/fpf_skiafontmgr.h @@ -44,9 +44,9 @@ class CFPF_SkiaFontDescriptor { m_pFamily[iSize] = 0; } FX_CHAR* m_pFamily; - FX_DWORD m_dwStyle; + uint32_t m_dwStyle; int32_t m_iFaceIndex; - FX_DWORD m_dwCharsets; + uint32_t m_dwCharsets; int32_t m_iGlyphNum; }; @@ -100,8 +100,8 @@ class CFPF_SkiaFontMgr : public IFPF_FontMgr { void LoadPrivateFont(void* pBuffer, size_t szBuffer) override; IFPF_Font* CreateFont(const CFX_ByteStringC& bsFamilyname, uint8_t uCharset, - FX_DWORD dwStyle, - FX_DWORD dwMatch = 0) override; + uint32_t dwStyle, + uint32_t dwMatch = 0) override; FX_BOOL InitFTLibrary(); FXFT_Face GetFontFace(IFX_FileRead* pFileRead, int32_t iFaceIndex = 0); @@ -119,7 +119,7 @@ class CFPF_SkiaFontMgr : public IFPF_FontMgr { FX_BOOL m_bLoaded; FXFT_Library m_FTLibrary; std::vector<CFPF_SkiaFontDescriptor*> m_FontFaces; - std::map<FX_DWORD, CFPF_SkiaFont*> m_FamilyFonts; + std::map<uint32_t, CFPF_SkiaFont*> m_FamilyFonts; }; #endif diff --git a/core/fxge/android/fx_android_font.cpp b/core/fxge/android/fx_android_font.cpp index 7218b5e7d0..d663ac0f4f 100644 --- a/core/fxge/android/fx_android_font.cpp +++ b/core/fxge/android/fx_android_font.cpp @@ -32,7 +32,7 @@ void* CFX_AndroidFontInfo::MapFont(int weight, if (!m_pFontMgr) { return NULL; } - FX_DWORD dwStyle = 0; + uint32_t dwStyle = 0; if (weight >= 700) { dwStyle |= FXFONT_BOLD; } @@ -54,10 +54,10 @@ void* CFX_AndroidFontInfo::MapFont(int weight, void* CFX_AndroidFontInfo::GetFont(const FX_CHAR* face) { return NULL; } -FX_DWORD CFX_AndroidFontInfo::GetFontData(void* hFont, - FX_DWORD table, +uint32_t CFX_AndroidFontInfo::GetFontData(void* hFont, + uint32_t table, uint8_t* buffer, - FX_DWORD size) { + uint32_t size) { if (!hFont) { return 0; } diff --git a/core/fxge/android/fx_android_font.h b/core/fxge/android/fx_android_font.h index 1ce4694f77..ee8859185e 100644 --- a/core/fxge/android/fx_android_font.h +++ b/core/fxge/android/fx_android_font.h @@ -30,10 +30,10 @@ class CFX_AndroidFontInfo : public IFX_SystemFontInfo { int& bExact); virtual void* GetFont(const FX_CHAR* face); - virtual FX_DWORD GetFontData(void* hFont, - FX_DWORD table, + virtual uint32_t GetFontData(void* hFont, + uint32_t table, uint8_t* buffer, - FX_DWORD size); + uint32_t size); virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name); virtual FX_BOOL GetFontCharset(void* hFont, int& charset); diff --git a/core/fxge/apple/apple_int.h b/core/fxge/apple/apple_int.h index c4f95d6d26..66d1daf73d 100644 --- a/core/fxge/apple/apple_int.h +++ b/core/fxge/apple/apple_int.h @@ -43,17 +43,17 @@ typedef enum eFXIOSFONTFLAG { eFXFontFlagScript = 1 << 4, } FX_IOSFONTFLAG; typedef struct IOS_FONTDATA_ { - FX_DWORD nHashCode; + uint32_t nHashCode; const char* psName; - FX_DWORD charsets; - FX_DWORD styles; + uint32_t charsets; + uint32_t styles; } IOS_FONTDATA; class CQuartz2D { public: void* createGraphics(CFX_DIBitmap* bitmap); void destroyGraphics(void* graphics); - void* CreateFont(const uint8_t* pFontData, FX_DWORD dwFontSize); + void* CreateFont(const uint8_t* pFontData, uint32_t dwFontSize); void DestroyFont(void* pFont); void setGraphicsTextMatrix(void* graphics, CFX_Matrix* matrix); FX_BOOL drawGraphicsString(void* graphics, @@ -97,21 +97,21 @@ class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { FX_BOOL DrawPath(const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState, - FX_DWORD fill_color, - FX_DWORD stroke_color, + uint32_t fill_color, + uint32_t stroke_color, int fill_mode, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) override; FX_BOOL SetPixel(int x, int y, - FX_DWORD color, + uint32_t color, int alpha_flag = 0, void* pIccTransform = NULL) override { return FALSE; } FX_BOOL FillRect(const FX_RECT* pRect, - FX_DWORD fill_color, + uint32_t fill_color, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) override; @@ -119,7 +119,7 @@ class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, - FX_DWORD color, + uint32_t color, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) override; @@ -131,7 +131,7 @@ class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { FX_BOOL bDEdge = FALSE) override; CFX_DIBitmap* GetBackDrop() override { return NULL; } FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD color, + uint32_t color, const FX_RECT* pSrcRect, int dest_left, int dest_top, @@ -139,21 +139,21 @@ class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { int alpha_flag = 0, void* pIccTransform = NULL) override; FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD color, + uint32_t color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, - FX_DWORD flags, + uint32_t flags, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) override; FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, - FX_DWORD color, + uint32_t color, const CFX_Matrix* pMatrix, - FX_DWORD flags, + uint32_t flags, void*& handle, int alpha_flag = 0, void* pIccTransform = NULL, @@ -170,7 +170,7 @@ class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { CFX_FontCache* pCache, const CFX_Matrix* pObject2Device, FX_FLOAT font_size, - FX_DWORD color, + uint32_t color, int alpha_flag = 0, void* pIccTransform = NULL) override; void* GetPlatformSurface() const override { return NULL; } @@ -191,7 +191,7 @@ class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { const CFX_Matrix* pGlyphMatrix, const CFX_Matrix* pObject2Device, FX_FLOAT font_size, - FX_DWORD argb, + uint32_t argb, int alpha_flag, void* pIccTransform); void CG_SetImageTransform(int dest_left, @@ -263,7 +263,7 @@ class CFX_FontProvider final : public IFX_FileRead { }; uint32_t FX_GetHashCode(const FX_CHAR* pStr); -FX_DWORD FX_IOSGetMatchFamilyNameHashcode(const FX_CHAR* pFontName); +uint32_t FX_IOSGetMatchFamilyNameHashcode(const FX_CHAR* pFontName); uint32_t FX_IOSGetFamilyNamesCount(); const FX_CHAR* FX_IOSGetFamilyName(uint32_t uIndex); #endif diff --git a/core/fxge/apple/fx_apple_platform.cpp b/core/fxge/apple/fx_apple_platform.cpp index 33dfbbc05c..9683b5c6f4 100644 --- a/core/fxge/apple/fx_apple_platform.cpp +++ b/core/fxge/apple/fx_apple_platform.cpp @@ -33,7 +33,7 @@ void CFX_FaceCache::InitPlatform() {} void CFX_FaceCache::DestroyPlatform() {} CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph_Nativetext( CFX_Font* pFont, - FX_DWORD glyph_index, + uint32_t glyph_index, const CFX_Matrix* pMatrix, int dest_width, int anti_alias) { @@ -46,7 +46,7 @@ static FX_BOOL _CGDrawGlyphRun(CGContextRef pContext, CFX_FontCache* pCache, const CFX_Matrix* pObject2Device, FX_FLOAT font_size, - FX_DWORD argb, + uint32_t argb, int alpha_flag, void* pIccTransform) { if (nChars == 0) { @@ -103,7 +103,7 @@ FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars, CFX_FontCache* pCache, const CFX_Matrix* pObject2Device, FX_FLOAT font_size, - FX_DWORD argb, + uint32_t argb, int alpha_flag, void* pIccTransform) { if (!pFont) { diff --git a/core/fxge/apple/fx_quartz_device.cpp b/core/fxge/apple/fx_quartz_device.cpp index dae396f7fe..b525660b7b 100644 --- a/core/fxge/apple/fx_quartz_device.cpp +++ b/core/fxge/apple/fx_quartz_device.cpp @@ -43,7 +43,7 @@ void CQuartz2D::destroyGraphics(void* graphics) { CGContextRelease((CGContextRef)graphics); } } -void* CQuartz2D::CreateFont(const uint8_t* pFontData, FX_DWORD dwFontSize) { +void* CQuartz2D::CreateFont(const uint8_t* pFontData, uint32_t dwFontSize) { CGDataProviderRef pDataProvider = CGDataProviderCreateWithData(NULL, pFontData, (size_t)dwFontSize, NULL); if (NULL == pDataProvider) { @@ -337,8 +337,8 @@ static CGBlendMode GetCGBlendMode(int blend_type) { FX_BOOL CFX_QuartzDeviceDriver::DrawPath(const CFX_PathData* pathData, const CFX_Matrix* matrix, const CFX_GraphStateData* graphState, - FX_DWORD fillArgb, - FX_DWORD strokeArgb, + uint32_t fillArgb, + uint32_t strokeArgb, int fillMode, int alpha_flag, void* pIccTransform, @@ -414,7 +414,7 @@ FX_BOOL CFX_QuartzDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, - FX_DWORD argb, + uint32_t argb, int alphaFlag, void* iccTransform, int blend_type) { @@ -636,7 +636,7 @@ FX_BOOL CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap, int dest_width, int dest_height, const FX_RECT* clipRect, - FX_DWORD flags, + uint32_t flags, int alphaFlag, void* iccTransform, int blend_type) { @@ -742,7 +742,7 @@ FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars, const CFX_Matrix* pGlyphMatrix, const CFX_Matrix* pObject2Device, FX_FLOAT font_size, - FX_DWORD argb, + uint32_t argb, int alpha_flag, void* pIccTransform) { if (nChars == 0) { @@ -807,7 +807,7 @@ FX_BOOL CFX_QuartzDeviceDriver::DrawDeviceText(int nChars, CFX_FontCache* pCache, const CFX_Matrix* pObject2Device, FX_FLOAT font_size, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform) { if (NULL == pFont || NULL == _context) { diff --git a/core/fxge/dib/dib_int.h b/core/fxge/dib/dib_int.h index 7022ec99ce..1d2193e9bb 100644 --- a/core/fxge/dib/dib_int.h +++ b/core/fxge/dib/dib_int.h @@ -82,7 +82,7 @@ class CStretchEngine { uint8_t* m_pDestMaskScanline; FX_RECT m_SrcClip; const CFX_DIBSource* m_pSource; - FX_DWORD* m_pSrcPalette; + uint32_t* m_pSrcPalette; int m_SrcWidth, m_SrcHeight; int m_SrcPitch, m_InterPitch; int m_ExtraMaskPitch; diff --git a/core/fxge/dib/fx_dib_composite.cpp b/core/fxge/dib/fx_dib_composite.cpp index 5bfe46e572..b10180deae 100644 --- a/core/fxge/dib/fx_dib_composite.cpp +++ b/core/fxge/dib/fx_dib_composite.cpp @@ -2149,7 +2149,7 @@ inline void _CompositeRow_1bppPal2Graya(uint8_t* dest_scan, } inline void _CompositeRow_8bppRgb2Rgb_NoBlend(uint8_t* dest_scan, const uint8_t* src_scan, - FX_DWORD* pPalette, + uint32_t* pPalette, int pixel_count, int DestBpp, const uint8_t* clip_scan, @@ -2217,7 +2217,7 @@ inline void _CompositeRow_8bppRgb2Rgb_NoBlend(uint8_t* dest_scan, inline void _CompositeRow_1bppRgb2Rgb_NoBlend(uint8_t* dest_scan, const uint8_t* src_scan, int src_left, - FX_DWORD* pPalette, + uint32_t* pPalette, int pixel_count, int DestBpp, const uint8_t* clip_scan) { @@ -2260,7 +2260,7 @@ inline void _CompositeRow_1bppRgb2Rgb_NoBlend(uint8_t* dest_scan, inline void _CompositeRow_8bppRgb2Argb_NoBlend(uint8_t* dest_scan, const uint8_t* src_scan, int width, - FX_DWORD* pPalette, + uint32_t* pPalette, const uint8_t* clip_scan, const uint8_t* src_alpha_scan) { if (src_alpha_scan) { @@ -2345,7 +2345,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend(uint8_t* dest_scan, void _CompositeRow_8bppRgb2Rgba_NoBlend(uint8_t* dest_scan, const uint8_t* src_scan, int width, - FX_DWORD* pPalette, + uint32_t* pPalette, const uint8_t* clip_scan, uint8_t* dest_alpha_scan, const uint8_t* src_alpha_scan) { @@ -2433,7 +2433,7 @@ inline void _CompositeRow_1bppRgb2Argb_NoBlend(uint8_t* dest_scan, const uint8_t* src_scan, int src_left, int width, - FX_DWORD* pPalette, + uint32_t* pPalette, const uint8_t* clip_scan) { int reset_r, reset_g, reset_b; int set_r, set_g, set_b; @@ -2483,7 +2483,7 @@ void _CompositeRow_1bppRgb2Rgba_NoBlend(uint8_t* dest_scan, const uint8_t* src_scan, int src_left, int width, - FX_DWORD* pPalette, + uint32_t* pPalette, const uint8_t* clip_scan, uint8_t* dest_alpha_scan) { int reset_r, reset_g, reset_b; @@ -3959,7 +3959,7 @@ void _CompositeRow_BitMask2Rgb_RgbByteOrder(uint8_t* dest_scan, } inline FX_BOOL _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int alpha_flag, - FX_DWORD mask_color, + uint32_t mask_color, int& mask_alpha, int& mask_red, int& mask_green, @@ -4026,8 +4026,8 @@ inline FX_BOOL _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, } inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB_Format dest_format, - FX_DWORD*& pDestPalette, - FX_DWORD* pSrcPalette, + uint32_t*& pDestPalette, + uint32_t* pSrcPalette, void* icc_module, void* pIccTransform) { ICodec_IccModule* pIccModule = (ICodec_IccModule*)icc_module; @@ -4039,9 +4039,9 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, if ((dest_format & 0xff) == 8) { int pal_count = 1 << (src_format & 0xff); uint8_t* gray_pal = FX_Alloc(uint8_t, pal_count); - pDestPalette = (FX_DWORD*)gray_pal; + pDestPalette = (uint32_t*)gray_pal; for (int i = 0; i < pal_count; i++) { - FX_DWORD color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i]) + uint32_t color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i]) : FXARGB_TODIB(pSrcPalette[i]); pIccModule->TranslateScanline(pIccTransform, gray_pal, (const uint8_t*)&color, 1); @@ -4049,9 +4049,9 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, } } else { int palsize = 1 << (src_format & 0xff); - pDestPalette = FX_Alloc(FX_DWORD, palsize); + pDestPalette = FX_Alloc(uint32_t, palsize); for (int i = 0; i < palsize; i++) { - FX_DWORD color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i]) + uint32_t color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i]) : FXARGB_TODIB(pSrcPalette[i]); pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&color, (const uint8_t*)&color, 1); @@ -4073,9 +4073,9 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, if ((dest_format & 0xff) == 8) { pIccModule->TranslateScanline(pIccTransform, gray_pal, gray_pal, pal_count); - pDestPalette = (FX_DWORD*)gray_pal; + pDestPalette = (uint32_t*)gray_pal; } else { - pDestPalette = FX_Alloc(FX_DWORD, pal_count); + pDestPalette = FX_Alloc(uint32_t, pal_count); for (int i = 0; i < pal_count; i++) { pIccModule->TranslateScanline( pIccTransform, (uint8_t*)&pDestPalette[i], &gray_pal[i], 1); @@ -4090,7 +4090,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, if ((dest_format & 0xff) == 8) { int pal_count = 1 << (src_format & 0xff); uint8_t* gray_pal = FX_Alloc(uint8_t, pal_count); - pDestPalette = (FX_DWORD*)gray_pal; + pDestPalette = (uint32_t*)gray_pal; if (isSrcCmyk) { for (int i = 0; i < pal_count; i++) { FX_CMYK cmyk = pSrcPalette[i]; @@ -4109,9 +4109,9 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, } } else { int palsize = 1 << (src_format & 0xff); - pDestPalette = FX_Alloc(FX_DWORD, palsize); + pDestPalette = FX_Alloc(uint32_t, palsize); if (isDstCmyk == isSrcCmyk) { - FXSYS_memcpy(pDestPalette, pSrcPalette, palsize * sizeof(FX_DWORD)); + FXSYS_memcpy(pDestPalette, pSrcPalette, palsize * sizeof(uint32_t)); } else { for (int i = 0; i < palsize; i++) { FX_CMYK cmyk = pSrcPalette[i]; @@ -4135,10 +4135,10 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, gray_pal[i] = i; } } - pDestPalette = (FX_DWORD*)gray_pal; + pDestPalette = (uint32_t*)gray_pal; } else { int palsize = 1 << (src_format & 0xff); - pDestPalette = FX_Alloc(FX_DWORD, palsize); + pDestPalette = FX_Alloc(uint32_t, palsize); if (palsize == 2) { pDestPalette[0] = isSrcCmyk ? 255 : 0xff000000; pDestPalette[1] = isSrcCmyk ? 0 : 0xffffffff; @@ -4175,8 +4175,8 @@ CFX_ScanlineCompositor::~CFX_ScanlineCompositor() { FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_format, int32_t width, - FX_DWORD* pSrcPalette, - FX_DWORD mask_color, + uint32_t* pSrcPalette, + uint32_t mask_color, int blend_type, FX_BOOL bClip, FX_BOOL bRgbByteOrder, @@ -4706,7 +4706,7 @@ FX_BOOL CFX_DIBitmap::CompositeMask(int dest_left, int width, int height, const CFX_DIBSource* pMask, - FX_DWORD color, + uint32_t color, int src_left, int src_top, int blend_type, @@ -4775,7 +4775,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform) { if (!m_pBuffer) { @@ -4791,7 +4791,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, return TRUE; } width = rect.Width(); - FX_DWORD dst_color; + uint32_t dst_color; if (alpha_flag >> 8) { dst_color = FXCMYK_TODIB(color); } else { @@ -4905,7 +4905,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, FXSYS_memset(dest_scan_alpha, 0xff, width); } if (Bpp == 4) { - FX_DWORD* scan = (FX_DWORD*)dest_scan; + uint32_t* scan = (uint32_t*)dest_scan; for (int col = 0; col < width; col++) { *scan++ = dst_color; } @@ -4996,7 +4996,7 @@ CFX_BitmapComposer::~CFX_BitmapComposer() { void CFX_BitmapComposer::Compose(CFX_DIBitmap* pDest, const CFX_ClipRgn* pClipRgn, int bitmap_alpha, - FX_DWORD mask_color, + uint32_t mask_color, FX_RECT& dest_rect, FX_BOOL bVertical, FX_BOOL bFlipX, @@ -5028,7 +5028,7 @@ void CFX_BitmapComposer::Compose(CFX_DIBitmap* pDest, FX_BOOL CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_format, - FX_DWORD* pSrcPalette) { + uint32_t* pSrcPalette) { m_SrcFormat = src_format; if (!m_Compositor.Init(m_pBitmap->GetFormat(), src_format, width, pSrcPalette, m_MaskColor, FXDIB_BLEND_NORMAL, diff --git a/core/fxge/dib/fx_dib_convert.cpp b/core/fxge/dib/fx_dib_convert.cpp index 9335800f9b..d9d5a3b0c0 100644 --- a/core/fxge/dib/fx_dib_convert.cpp +++ b/core/fxge/dib/fx_dib_convert.cpp @@ -14,20 +14,20 @@ class CFX_Palette { ~CFX_Palette(); FX_BOOL BuildPalette(const CFX_DIBSource* pBitmap); - FX_DWORD* GetPalette() const { return m_pPalette; } - FX_DWORD* GetColorLut() const { return m_cLut; } - FX_DWORD* GetAmountLut() const { return m_aLut; } + uint32_t* GetPalette() const { return m_pPalette; } + uint32_t* GetColorLut() const { return m_cLut; } + uint32_t* GetAmountLut() const { return m_aLut; } int32_t Getlut() const { return m_lut; } protected: - FX_DWORD* m_pPalette; - FX_DWORD* m_cLut; - FX_DWORD* m_aLut; + uint32_t* m_pPalette; + uint32_t* m_cLut; + uint32_t* m_aLut; int m_lut; }; -int _Partition(FX_DWORD* alut, FX_DWORD* clut, int l, int r) { - FX_DWORD p_a = alut[l]; - FX_DWORD p_c = clut[l]; +int _Partition(uint32_t* alut, uint32_t* clut, int l, int r) { + uint32_t p_a = alut[l]; + uint32_t p_c = clut[l]; while (l < r) { while (l < r && alut[r] >= p_a) { r--; @@ -48,34 +48,34 @@ int _Partition(FX_DWORD* alut, FX_DWORD* clut, int l, int r) { clut[l] = p_c; return l; } -void _Qsort(FX_DWORD* alut, FX_DWORD* clut, int l, int r) { +void _Qsort(uint32_t* alut, uint32_t* clut, int l, int r) { if (l < r) { int pI = _Partition(alut, clut, l, r); _Qsort(alut, clut, l, pI - 1); _Qsort(alut, clut, pI + 1, r); } } -void _ColorDecode(FX_DWORD pal_v, uint8_t& r, uint8_t& g, uint8_t& b) { +void _ColorDecode(uint32_t pal_v, uint8_t& r, uint8_t& g, uint8_t& b) { r = (uint8_t)((pal_v & 0xf00) >> 4); g = (uint8_t)(pal_v & 0x0f0); b = (uint8_t)((pal_v & 0x00f) << 4); } -void _Obtain_Pal(FX_DWORD* aLut, - FX_DWORD* cLut, - FX_DWORD* dest_pal, - FX_DWORD lut) { - FX_DWORD lut_1 = lut - 1; +void _Obtain_Pal(uint32_t* aLut, + uint32_t* cLut, + uint32_t* dest_pal, + uint32_t lut) { + uint32_t lut_1 = lut - 1; for (int row = 0; row < 256; row++) { int lut_offset = lut_1 - row; if (lut_offset < 0) { lut_offset += 256; } - FX_DWORD color = cLut[lut_offset]; + uint32_t color = cLut[lut_offset]; uint8_t r; uint8_t g; uint8_t b; _ColorDecode(color, r, g, b); - dest_pal[row] = ((FX_DWORD)r << 16) | ((FX_DWORD)g << 8) | b | 0xff000000; + dest_pal[row] = ((uint32_t)r << 16) | ((uint32_t)g << 8) | b | 0xff000000; aLut[lut_offset] = row; } } @@ -97,7 +97,7 @@ FX_BOOL CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap) { return FALSE; } FX_Free(m_pPalette); - m_pPalette = FX_Alloc(FX_DWORD, 256); + m_pPalette = FX_Alloc(uint32_t, 256); int bpp = pBitmap->GetBPP() / 8; int width = pBitmap->GetWidth(); int height = pBitmap->GetHeight(); @@ -105,18 +105,18 @@ FX_BOOL CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap) { m_cLut = NULL; FX_Free(m_aLut); m_aLut = NULL; - m_cLut = FX_Alloc(FX_DWORD, 4096); - m_aLut = FX_Alloc(FX_DWORD, 4096); + m_cLut = FX_Alloc(uint32_t, 4096); + m_aLut = FX_Alloc(uint32_t, 4096); int row, col; m_lut = 0; for (row = 0; row < height; row++) { uint8_t* scan_line = (uint8_t*)pBitmap->GetScanline(row); for (col = 0; col < width; col++) { uint8_t* src_port = scan_line + col * bpp; - FX_DWORD b = src_port[0] & 0xf0; - FX_DWORD g = src_port[1] & 0xf0; - FX_DWORD r = src_port[2] & 0xf0; - FX_DWORD index = (r << 4) + g + (b >> 4); + uint32_t b = src_port[0] & 0xf0; + uint32_t g = src_port[1] & 0xf0; + uint32_t r = src_port[2] & 0xf0; + uint32_t index = (r << 4) + g + (b >> 4); m_aLut[index]++; } } @@ -176,10 +176,10 @@ FX_BOOL ConvertBuffer_1bppPlt2Gray(uint8_t* dest_buf, int src_left, int src_top, void* pIccTransform) { - FX_DWORD* src_plt = pSrcBitmap->GetPalette(); + uint32_t* src_plt = pSrcBitmap->GetPalette(); uint8_t gray[2]; if (pIccTransform) { - FX_DWORD plt[2]; + uint32_t plt[2]; if (pSrcBitmap->IsCmykImage()) { plt[0] = FXCMYK_TODIB(src_plt[0]); plt[1] = FXCMYK_TODIB(src_plt[1]); @@ -238,10 +238,10 @@ FX_BOOL ConvertBuffer_8bppPlt2Gray(uint8_t* dest_buf, int src_left, int src_top, void* pIccTransform) { - FX_DWORD* src_plt = pSrcBitmap->GetPalette(); + uint32_t* src_plt = pSrcBitmap->GetPalette(); uint8_t gray[256]; if (pIccTransform) { - FX_DWORD plt[256]; + uint32_t plt[256]; if (pSrcBitmap->IsCmykImage()) { for (int i = 0; i < 256; i++) { plt[i] = FXCMYK_TODIB(src_plt[i]); @@ -323,10 +323,10 @@ FX_BOOL ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, pSrcBitmap->GetScanline(src_top + row) + src_left * 4; for (int col = 0; col < width; col++) { uint8_t r, g, b; - AdobeCMYK_to_sRGB1(FXSYS_GetCValue((FX_DWORD)src_scan[0]), - FXSYS_GetMValue((FX_DWORD)src_scan[1]), - FXSYS_GetYValue((FX_DWORD)src_scan[2]), - FXSYS_GetKValue((FX_DWORD)src_scan[3]), r, g, b); + AdobeCMYK_to_sRGB1(FXSYS_GetCValue((uint32_t)src_scan[0]), + FXSYS_GetMValue((uint32_t)src_scan[1]), + FXSYS_GetYValue((uint32_t)src_scan[2]), + FXSYS_GetKValue((uint32_t)src_scan[3]), r, g, b); *dest_scan++ = FXRGB2GRAY(r, g, b); src_scan += 4; } @@ -380,14 +380,14 @@ FX_BOOL ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, - FX_DWORD* dst_plt, + uint32_t* dst_plt, void* pIccTransform) { ConvertBuffer_IndexCopy(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top); - FX_DWORD* src_plt = pSrcBitmap->GetPalette(); + uint32_t* src_plt = pSrcBitmap->GetPalette(); int plt_size = pSrcBitmap->GetPaletteSize(); if (pIccTransform) { - FX_DWORD plt[256]; + uint32_t plt[256]; uint8_t* bgr_ptr = (uint8_t*)plt; if (pSrcBitmap->IsCmykImage()) { for (int i = 0; i < plt_size; i++) { @@ -431,18 +431,18 @@ FX_BOOL ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, - FX_DWORD* dst_plt) { + uint32_t* dst_plt) { int bpp = pSrcBitmap->GetBPP() / 8; int row, col; CFX_Palette palette; palette.BuildPalette(pSrcBitmap); - FX_DWORD* cLut = palette.GetColorLut(); - FX_DWORD* aLut = palette.GetAmountLut(); + uint32_t* cLut = palette.GetColorLut(); + uint32_t* aLut = palette.GetAmountLut(); if (!cLut || !aLut) { return FALSE; } int lut = palette.Getlut(); - FX_DWORD* pPalette = palette.GetPalette(); + uint32_t* pPalette = palette.GetPalette(); if (lut > 256) { int err, min_err; int lut_256 = lut - 256; @@ -452,7 +452,7 @@ FX_BOOL ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, _ColorDecode(cLut[row], r, g, b); int clrindex = 0; for (int col = 0; col < 256; col++) { - FX_DWORD p_color = *(pPalette + col); + uint32_t p_color = *(pPalette + col); int d_r = r - (uint8_t)(p_color >> 16); int d_g = g - (uint8_t)(p_color >> 8); int d_b = b - (uint8_t)(p_color); @@ -475,7 +475,7 @@ FX_BOOL ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, int r = src_port[2] & 0xf0; int g = src_port[1] & 0xf0; int b = src_port[0] & 0xf0; - FX_DWORD clrindex = (r << 4) + g + (b >> 4); + uint32_t clrindex = (r << 4) + g + (b >> 4); for (int i = lut_1; i >= 0; i--) if (clrindex == cLut[i]) { *(dest_scan + col) = (uint8_t)(aLut[i]); @@ -483,7 +483,7 @@ FX_BOOL ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, } } } - FXSYS_memcpy(dst_plt, pPalette, sizeof(FX_DWORD) * 256); + FXSYS_memcpy(dst_plt, pPalette, sizeof(uint32_t) * 256); return TRUE; } FX_BOOL ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, @@ -493,7 +493,7 @@ FX_BOOL ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, - FX_DWORD* dst_plt, + uint32_t* dst_plt, void* pIccTransform) { FX_BOOL ret = ConvertBuffer_Rgb2PltRgb8_NoTransform( dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, @@ -574,8 +574,8 @@ FX_BOOL ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, int src_top, void* pIccTransform) { int comps = (dst_format & 0xff) / 8; - FX_DWORD* src_plt = pSrcBitmap->GetPalette(); - FX_DWORD plt[2]; + uint32_t* src_plt = pSrcBitmap->GetPalette(); + uint32_t plt[2]; uint8_t* bgr_ptr = (uint8_t*)plt; if (pSrcBitmap->IsCmykImage()) { plt[0] = FXCMYK_TODIB(src_plt[0]); @@ -633,8 +633,8 @@ FX_BOOL ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, int src_top, void* pIccTransform) { int comps = (dst_format & 0xff) / 8; - FX_DWORD* src_plt = pSrcBitmap->GetPalette(); - FX_DWORD plt[256]; + uint32_t* src_plt = pSrcBitmap->GetPalette(); + uint32_t plt[256]; uint8_t* bgr_ptr = (uint8_t*)plt; if (!pSrcBitmap->IsCmykImage()) { for (int i = 0; i < 256; i++) { @@ -817,7 +817,7 @@ FX_BOOL ConvertBuffer(FXDIB_Format dest_format, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, - FX_DWORD*& d_pal, + uint32_t*& d_pal, void* pIccTransform) { FXDIB_Format src_format = pSrcBitmap->GetFormat(); if (!CFX_GEModule::Get()->GetCodecModule() || @@ -864,7 +864,7 @@ FX_BOOL ConvertBuffer(FXDIB_Format dest_format, height, pSrcBitmap, src_left, src_top, d_pal, pIccTransform); } - d_pal = FX_Alloc(FX_DWORD, 256); + d_pal = FX_Alloc(uint32_t, 256); if (((src_format & 0xff) == 1 || (src_format & 0xff) == 8) && pSrcBitmap->GetPalette()) { return ConvertBuffer_Plt2PltRgb8(dest_buf, dest_pitch, width, height, @@ -997,7 +997,7 @@ CFX_DIBitmap* CFX_DIBSource::CloneConvert(FXDIB_Format dest_format, delete pClone; return NULL; } - FX_DWORD* pal_8bpp = NULL; + uint32_t* pal_8bpp = NULL; ret = ConvertBuffer(dest_format, pClone->GetBuffer(), pClone->GetPitch(), m_Width, m_Height, this, 0, 0, pal_8bpp, pIccTransform); if (!ret) { @@ -1075,7 +1075,7 @@ FX_BOOL CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, } } FX_BOOL ret = FALSE; - FX_DWORD* pal_8bpp = NULL; + uint32_t* pal_8bpp = NULL; ret = ConvertBuffer(dest_format, dest_buf, dest_pitch, m_Width, m_Height, this, 0, 0, pal_8bpp, pIccTransform); if (!ret) { diff --git a/core/fxge/dib/fx_dib_engine.cpp b/core/fxge/dib/fx_dib_engine.cpp index 10e5e67bbc..a68583b346 100644 --- a/core/fxge/dib/fx_dib_engine.cpp +++ b/core/fxge/dib/fx_dib_engine.cpp @@ -231,7 +231,7 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap, m_pExtraAlphaBuf = NULL; m_pDestMaskScanline = NULL; m_DestClip = clip_rect; - FX_DWORD size = clip_rect.Width(); + uint32_t size = clip_rect.Width(); if (size && m_DestBpp > (int)(INT_MAX / size)) { return; } @@ -351,7 +351,7 @@ FX_BOOL CStretchEngine::StartStretchHorz() { 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; + uint32_t size = (m_DestClip.Width() * 8 + 31) / 32 * 4; m_pDestMaskScanline = FX_TryAlloc(unsigned char, size); if (!m_pDestMaskScanline) { return FALSE; @@ -730,9 +730,9 @@ void CStretchEngine::StretchVert() { dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a; } if (dest_a) { - int r = ((FX_DWORD)dest_r_y) * 255 / dest_a; - int g = ((FX_DWORD)dest_g_m) * 255 / dest_a; - int b = ((FX_DWORD)dest_b_c) * 255 / dest_a; + int r = ((uint32_t)dest_r_y) * 255 / dest_a; + int g = ((uint32_t)dest_g_m) * 255 / dest_a; + int b = ((uint32_t)dest_b_c) * 255 / dest_a; dest_scan[0] = b > 255 ? 255 : b < 0 ? 0 : b; dest_scan[1] = g > 255 ? 255 : g < 0 ? 0 : g; dest_scan[2] = r > 255 ? 255 : r < 0 ? 0 : r; @@ -782,7 +782,7 @@ FX_BOOL CFX_ImageStretcher::Start(IFX_ScanlineComposer* pDest, int dest_width, int dest_height, const FX_RECT& rect, - FX_DWORD flags) { + uint32_t flags) { m_DestFormat = _GetStretchedFormat(pSource); m_DestBPP = m_DestFormat & 0xff; m_pDest = pDest; @@ -863,7 +863,7 @@ FX_BOOL CFX_ImageStretcher::StartQuickStretch() { m_DestHeight = -m_DestHeight; } m_LineIndex = 0; - FX_DWORD size = m_ClipRect.Width(); + uint32_t size = m_ClipRect.Width(); if (size && m_DestBPP > (int)(INT_MAX / size)) { return FALSE; } diff --git a/core/fxge/dib/fx_dib_main.cpp b/core/fxge/dib/fx_dib_main.cpp index a7f7dc75bc..3772459eca 100644 --- a/core/fxge/dib/fx_dib_main.cpp +++ b/core/fxge/dib/fx_dib_main.cpp @@ -20,25 +20,25 @@ FX_BOOL ConvertBuffer(FXDIB_Format dest_format, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, - FX_DWORD*& pal, + uint32_t*& pal, void* pIccTransform); -void CmykDecode(FX_DWORD cmyk, int& c, int& m, int& y, int& k) { +void CmykDecode(uint32_t cmyk, int& c, int& m, int& y, int& k) { c = FXSYS_GetCValue(cmyk); m = FXSYS_GetMValue(cmyk); y = FXSYS_GetYValue(cmyk); k = FXSYS_GetKValue(cmyk); } -void ArgbDecode(FX_DWORD argb, int& a, int& r, int& g, int& b) { +void ArgbDecode(uint32_t argb, int& a, int& r, int& g, int& b) { a = FXARGB_A(argb); r = FXARGB_R(argb); g = FXARGB_G(argb); b = FXARGB_B(argb); } -void ArgbDecode(FX_DWORD argb, int& a, FX_COLORREF& rgb) { +void ArgbDecode(uint32_t argb, int& a, FX_COLORREF& rgb) { a = FXARGB_A(argb); rgb = FXSYS_RGB(FXARGB_R(argb), FXARGB_G(argb), FXARGB_B(argb)); } -FX_DWORD ArgbEncode(int a, FX_COLORREF rgb) { +uint32_t ArgbEncode(int a, FX_COLORREF rgb) { return FXARGB_MAKE(a, FXSYS_GetRValue(rgb), FXSYS_GetGValue(rgb), FXSYS_GetBValue(rgb)); } @@ -196,8 +196,8 @@ CFX_DIBitmap* CFX_DIBSource::Clone(const FX_RECT* pClip) const { int right_shift = 32 - left_shift; int dword_count = pNewBitmap->m_Pitch / 4; for (int row = rect.top; row < rect.bottom; row++) { - FX_DWORD* src_scan = (FX_DWORD*)GetScanline(row) + rect.left / 32; - FX_DWORD* dest_scan = (FX_DWORD*)pNewBitmap->GetScanline(row - rect.top); + uint32_t* src_scan = (uint32_t*)GetScanline(row) + rect.left / 32; + uint32_t* dest_scan = (uint32_t*)pNewBitmap->GetScanline(row - rect.top); for (int i = 0; i < dword_count; i++) { dest_scan[i] = (src_scan[i] << left_shift) | (src_scan[i + 1] >> right_shift); @@ -205,7 +205,7 @@ CFX_DIBitmap* CFX_DIBSource::Clone(const FX_RECT* pClip) const { } } else { int copy_len = (pNewBitmap->GetWidth() * pNewBitmap->GetBPP() + 7) / 8; - if (m_Pitch < (FX_DWORD)copy_len) { + if (m_Pitch < (uint32_t)copy_len) { copy_len = m_Pitch; } for (int row = rect.top; row < rect.bottom; row++) { @@ -221,7 +221,7 @@ void CFX_DIBSource::BuildPalette() { return; } if (GetBPP() == 1) { - m_pPalette = FX_Alloc(FX_DWORD, 2); + m_pPalette = FX_Alloc(uint32_t, 2); if (IsCmykImage()) { m_pPalette[0] = 0xff; m_pPalette[1] = 0; @@ -230,7 +230,7 @@ void CFX_DIBSource::BuildPalette() { m_pPalette[1] = 0xffffffff; } } else if (GetBPP() == 8) { - m_pPalette = FX_Alloc(FX_DWORD, 256); + m_pPalette = FX_Alloc(uint32_t, 256); if (IsCmykImage()) { for (int i = 0; i < 256; i++) { m_pPalette[i] = 0xff - i; @@ -256,7 +256,7 @@ FX_BOOL CFX_DIBSource::BuildAlphaMask() { m_pAlphaMask->GetHeight() * m_pAlphaMask->GetPitch()); return TRUE; } -FX_DWORD CFX_DIBSource::GetPaletteEntry(int index) const { +uint32_t CFX_DIBSource::GetPaletteEntry(int index) const { ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask()); if (m_pPalette) { return m_pPalette[index]; @@ -272,14 +272,14 @@ FX_DWORD CFX_DIBSource::GetPaletteEntry(int index) const { } return index * 0x10101 | 0xff000000; } -void CFX_DIBSource::SetPaletteEntry(int index, FX_DWORD color) { +void CFX_DIBSource::SetPaletteEntry(int index, uint32_t color) { ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask()); if (!m_pPalette) { BuildPalette(); } m_pPalette[index] = color; } -int CFX_DIBSource::FindPalette(FX_DWORD color) const { +int CFX_DIBSource::FindPalette(uint32_t color) const { ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask()); if (!m_pPalette) { if (IsCmykImage()) { @@ -300,7 +300,7 @@ int CFX_DIBSource::FindPalette(FX_DWORD color) const { } return -1; } -void CFX_DIBitmap::Clear(FX_DWORD color) { +void CFX_DIBitmap::Clear(uint32_t color) { if (!m_pBuffer) { return; } @@ -345,7 +345,7 @@ void CFX_DIBitmap::Clear(FX_DWORD color) { case FXDIB_Argb: { color = IsCmykImage() ? FXCMYK_TODIB(color) : FXARGB_TODIB(color); for (int i = 0; i < m_Width; i++) { - ((FX_DWORD*)m_pBuffer)[i] = color; + ((uint32_t*)m_pBuffer)[i] = color; } for (int row = 1; row < m_Height; row++) { FXSYS_memcpy(m_pBuffer + row * m_Pitch, m_pBuffer, m_Pitch); @@ -446,7 +446,7 @@ FX_BOOL CFX_DIBitmap::TransferBitmap(int dest_left, } uint8_t* dest_buf = m_pBuffer + dest_top * m_Pitch + dest_left * GetBPP() / 8; - FX_DWORD* d_plt = NULL; + uint32_t* d_plt = NULL; if (!ConvertBuffer(dest_format, dest_buf, m_Pitch, width, height, pSrcBitmap, src_left, src_top, d_plt, pIccTransform)) { return FALSE; @@ -459,7 +459,7 @@ FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int width, int height, const CFX_DIBSource* pMask, - FX_DWORD color, + uint32_t color, int src_left, int src_top, int alpha_flag, @@ -479,7 +479,7 @@ FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, } int src_bpp = pMask->GetBPP(); int alpha; - FX_DWORD dst_color; + uint32_t dst_color; if (alpha_flag >> 8) { alpha = alpha_flag & 0xff; dst_color = FXCMYK_TODIB(color); @@ -507,8 +507,8 @@ FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, } if (GetFormat() == FXDIB_Argb) { for (int row = 0; row < height; row++) { - FX_DWORD* dest_pos = - (FX_DWORD*)(m_pBuffer + (dest_top + row) * m_Pitch + dest_left * 4); + uint32_t* dest_pos = + (uint32_t*)(m_pBuffer + (dest_top + row) * m_Pitch + dest_left * 4); const uint8_t* src_scan = pMask->GetScanline(src_top + row); if (src_bpp == 1) { for (int col = 0; col < width; col++) { @@ -563,22 +563,22 @@ FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, } return TRUE; } -void CFX_DIBSource::CopyPalette(const FX_DWORD* pSrc, FX_DWORD size) { +void CFX_DIBSource::CopyPalette(const uint32_t* pSrc, uint32_t size) { if (!pSrc || GetBPP() > 8) { FX_Free(m_pPalette); m_pPalette = NULL; } else { - FX_DWORD pal_size = 1 << GetBPP(); + uint32_t pal_size = 1 << GetBPP(); if (!m_pPalette) { - m_pPalette = FX_Alloc(FX_DWORD, pal_size); + m_pPalette = FX_Alloc(uint32_t, pal_size); } if (pal_size > size) { pal_size = size; } - FXSYS_memcpy(m_pPalette, pSrc, pal_size * sizeof(FX_DWORD)); + FXSYS_memcpy(m_pPalette, pSrc, pal_size * sizeof(uint32_t)); } } -void CFX_DIBSource::GetPalette(FX_DWORD* pal, int alpha) const { +void CFX_DIBSource::GetPalette(uint32_t* pal, int alpha) const { ASSERT(GetBPP() <= 8 && !IsCmykImage()); if (GetBPP() == 1) { pal[0] = @@ -1068,7 +1068,7 @@ FX_BOOL CFX_DIBitmap::MultiplyAlpha(int alpha) { } return TRUE; } -FX_DWORD CFX_DIBitmap::GetPixel(int x, int y) const { +uint32_t CFX_DIBitmap::GetPixel(int x, int y) const { if (!m_pBuffer) { return 0; } @@ -1101,7 +1101,7 @@ FX_DWORD CFX_DIBitmap::GetPixel(int x, int y) const { } return 0; } -void CFX_DIBitmap::SetPixel(int x, int y, FX_DWORD color) { +void CFX_DIBitmap::SetPixel(int x, int y, uint32_t color) { if (!m_pBuffer) { return; } @@ -1184,8 +1184,8 @@ void CFX_DIBitmap::DownSampleScanline(int line, uint8_t* scanline = m_pBuffer + line * m_Pitch; if (src_Bpp == 0) { for (int i = 0; i < clip_width; i++) { - FX_DWORD dest_x = clip_left + i; - FX_DWORD src_x = dest_x * m_Width / dest_width; + uint32_t dest_x = clip_left + i; + uint32_t src_x = dest_x * m_Width / dest_width; if (bFlipX) { src_x = m_Width - src_x - 1; } @@ -1194,8 +1194,8 @@ void CFX_DIBitmap::DownSampleScanline(int line, } } else if (src_Bpp == 1) { for (int i = 0; i < clip_width; i++) { - FX_DWORD dest_x = clip_left + i; - FX_DWORD src_x = dest_x * m_Width / dest_width; + uint32_t dest_x = clip_left + i; + uint32_t src_x = dest_x * m_Width / dest_width; if (bFlipX) { src_x = m_Width - src_x - 1; } @@ -1222,8 +1222,8 @@ void CFX_DIBitmap::DownSampleScanline(int line, } } else { for (int i = 0; i < clip_width; i++) { - FX_DWORD dest_x = clip_left + i; - FX_DWORD src_x = + uint32_t dest_x = clip_left + i; + uint32_t src_x = bFlipX ? (m_Width - dest_x * m_Width / dest_width - 1) * src_Bpp : (dest_x * m_Width / dest_width) * src_Bpp; src_x %= m_Width * src_Bpp; @@ -1237,8 +1237,8 @@ void CFX_DIBitmap::DownSampleScanline(int line, // TODO(weili): Split this function into two for handling CMYK and RGB // colors separately. -FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, - FX_DWORD backcolor) { +FX_BOOL CFX_DIBitmap::ConvertColorScale(uint32_t forecolor, + uint32_t backcolor) { ASSERT(!IsAlphaMask()); if (!m_pBuffer || IsAlphaMask()) { return FALSE; @@ -1371,7 +1371,7 @@ FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, } return TRUE; } -FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, +FX_BOOL CFX_DIBitmap::DitherFS(const uint32_t* pPalette, int pal_size, const FX_RECT* pRect) { if (!m_pBuffer) { @@ -1498,7 +1498,7 @@ CFX_DIBitmap* CFX_DIBSource::FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const { } else { ASSERT(Bpp == 4); for (int col = 0; col < m_Width; col++) { - *(FX_DWORD*)dest_scan = *(FX_DWORD*)src_scan; + *(uint32_t*)dest_scan = *(uint32_t*)src_scan; dest_scan -= 4; src_scan += 4; } @@ -1507,7 +1507,7 @@ CFX_DIBitmap* CFX_DIBSource::FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const { } if (m_pAlphaMask) { pDestBuffer = pFlipped->m_pAlphaMask->GetBuffer(); - FX_DWORD dest_pitch = pFlipped->m_pAlphaMask->GetPitch(); + uint32_t dest_pitch = pFlipped->m_pAlphaMask->GetPitch(); for (int row = 0; row < m_Height; row++) { const uint8_t* src_scan = m_pAlphaMask->GetScanline(row); uint8_t* dest_scan = @@ -1595,9 +1595,9 @@ FX_BOOL CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn, const CFX_DIBSource* pSource, int bitmap_alpha, - FX_DWORD mask_color, + uint32_t mask_color, const CFX_Matrix* pMatrix, - FX_DWORD dib_flags, + uint32_t dib_flags, FX_BOOL bRgbByteOrder, int alpha_flag, void* pIccTransform, @@ -1748,7 +1748,7 @@ void CFX_BitmapStorer::ComposeScanline(int line, FX_BOOL CFX_BitmapStorer::SetInfo(int width, int height, FXDIB_Format src_format, - FX_DWORD* pSrcPalette) { + uint32_t* pSrcPalette) { m_pBitmap = new CFX_DIBitmap; if (!m_pBitmap->Create(width, height, src_format)) { delete m_pBitmap; diff --git a/core/fxge/dib/fx_dib_transform.cpp b/core/fxge/dib/fx_dib_transform.cpp index dc6fb93c75..91c65fbbc8 100644 --- a/core/fxge/dib/fx_dib_transform.cpp +++ b/core/fxge/dib/fx_dib_transform.cpp @@ -229,9 +229,9 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, dest_scan += (result_height - 1) * dest_pitch; } if (nBytes == 4) { - FX_DWORD* src_scan = (FX_DWORD*)GetScanline(row) + col_start; + uint32_t* src_scan = (uint32_t*)GetScanline(row) + col_start; for (int col = col_start; col < col_end; col++) { - *(FX_DWORD*)dest_scan = *src_scan++; + *(uint32_t*)dest_scan = *src_scan++; dest_scan += dest_step; } } else { @@ -299,7 +299,7 @@ FX_RECT FXDIB_SwapClipBox(FX_RECT& clip, CFX_DIBitmap* CFX_DIBSource::TransformTo(const CFX_Matrix* pDestMatrix, int& result_left, int& result_top, - FX_DWORD flags, + uint32_t flags, const FX_RECT* pDestClip) const { CFX_ImageTransformer transformer; transformer.Start(this, pDestMatrix, flags, pDestClip); @@ -311,7 +311,7 @@ CFX_DIBitmap* CFX_DIBSource::TransformTo(const CFX_Matrix* pDestMatrix, } CFX_DIBitmap* CFX_DIBSource::StretchTo(int dest_width, int dest_height, - FX_DWORD flags, + uint32_t flags, const FX_RECT* pClip) const { FX_RECT clip_rect(0, 0, FXSYS_abs(dest_width), FXSYS_abs(dest_height)); if (pClip) { @@ -623,7 +623,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) { int Bpp = m_Storer.GetBitmap()->GetBPP() / 8; int destBpp = pTransformed->GetBPP() / 8; if (Bpp == 1) { - FX_DWORD argb[256]; + uint32_t argb[256]; FX_ARGB* pPal = m_Storer.GetBitmap()->GetPalette(); if (pPal) { for (int i = 0; i < 256; i++) { @@ -667,7 +667,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) { } int row_offset_l = src_row_l * stretch_pitch; int row_offset_r = src_row_r * stretch_pitch; - FX_DWORD r_bgra_cmyk = argb[bilinear_interpol( + uint32_t r_bgra_cmyk = argb[bilinear_interpol( stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, 1, 0)]; if (transformF == FXDIB_Rgba) { @@ -675,7 +675,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) { dest_pos[1] = (uint8_t)(r_bgra_cmyk >> 16); dest_pos[2] = (uint8_t)(r_bgra_cmyk >> 8); } else { - *(FX_DWORD*)dest_pos = r_bgra_cmyk; + *(uint32_t*)dest_pos = r_bgra_cmyk; } } dest_pos += destBpp; @@ -702,7 +702,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) { bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height); - FX_DWORD r_bgra_cmyk = + uint32_t r_bgra_cmyk = argb[bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, 1, 0)]; if (transformF == FXDIB_Rgba) { @@ -710,7 +710,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) { dest_pos[1] = (uint8_t)(r_bgra_cmyk >> 16); dest_pos[2] = (uint8_t)(r_bgra_cmyk >> 8); } else { - *(FX_DWORD*)dest_pos = r_bgra_cmyk; + *(uint32_t*)dest_pos = r_bgra_cmyk; } } dest_pos += destBpp; @@ -731,14 +731,14 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) { if (src_row == stretch_height) { src_row--; } - FX_DWORD r_bgra_cmyk = + uint32_t r_bgra_cmyk = argb[stretch_buf[src_row * stretch_pitch + src_col]]; if (transformF == FXDIB_Rgba) { dest_pos[0] = (uint8_t)(r_bgra_cmyk >> 24); dest_pos[1] = (uint8_t)(r_bgra_cmyk >> 16); dest_pos[2] = (uint8_t)(r_bgra_cmyk >> 8); } else { - *(FX_DWORD*)dest_pos = r_bgra_cmyk; + *(uint32_t*)dest_pos = r_bgra_cmyk; } } dest_pos += destBpp; @@ -794,7 +794,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) { r_pos_k_r = bilinear_interpol( stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 3); - *(FX_DWORD*)dest_pos = + *(uint32_t*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r)); } @@ -802,7 +802,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) { uint8_t r_pos_a_r = bilinear_interpol( stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 3); - *(FX_DWORD*)dest_pos = FXARGB_TODIB( + *(uint32_t*)dest_pos = FXARGB_TODIB( FXARGB_MAKE(r_pos_a_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r)); } @@ -812,11 +812,11 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) { r_pos_k_r = bilinear_interpol( stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 3); - *(FX_DWORD*)dest_pos = + *(uint32_t*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r)); } else { - *(FX_DWORD*)dest_pos = FXARGB_TODIB( + *(uint32_t*)dest_pos = FXARGB_TODIB( FXARGB_MAKE(r_pos_k_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r)); } @@ -865,7 +865,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) { r_pos_k_r = bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 3); - *(FX_DWORD*)dest_pos = + *(uint32_t*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r)); } @@ -873,7 +873,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) { uint8_t r_pos_a_r = bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 3); - *(FX_DWORD*)dest_pos = FXARGB_TODIB( + *(uint32_t*)dest_pos = FXARGB_TODIB( FXARGB_MAKE(r_pos_a_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r)); } @@ -883,11 +883,11 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) { r_pos_k_r = bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 3); - *(FX_DWORD*)dest_pos = + *(uint32_t*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r)); } else { - *(FX_DWORD*)dest_pos = FXARGB_TODIB( + *(uint32_t*)dest_pos = FXARGB_TODIB( FXARGB_MAKE(r_pos_k_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r)); } @@ -920,19 +920,19 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) { dest_pos[1] = src_pos[1]; dest_pos[2] = src_pos[2]; } else { - *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode( + *(uint32_t*)dest_pos = FXCMYK_TODIB(CmykEncode( src_pos[0], src_pos[1], src_pos[2], src_pos[3])); } } else { - *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE( + *(uint32_t*)dest_pos = FXARGB_TODIB(FXARGB_MAKE( src_pos[3], src_pos[2], src_pos[1], src_pos[0])); } } else { if (transformF == FXDIB_Cmyka) { - *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode( + *(uint32_t*)dest_pos = FXCMYK_TODIB(CmykEncode( src_pos[0], src_pos[1], src_pos[2], src_pos[3])); } else { - *(FX_DWORD*)dest_pos = FXARGB_TODIB( + *(uint32_t*)dest_pos = FXARGB_TODIB( FXARGB_MAKE(0xff, src_pos[2], src_pos[1], src_pos[0])); } } diff --git a/core/fxge/ge/fx_ge_device.cpp b/core/fxge/ge/fx_ge_device.cpp index eefac5c033..d791859b03 100644 --- a/core/fxge/ge/fx_ge_device.cpp +++ b/core/fxge/ge/fx_ge_device.cpp @@ -113,8 +113,8 @@ void CFX_RenderDevice::UpdateClipBox() { FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState, - FX_DWORD fill_color, - FX_DWORD stroke_color, + uint32_t fill_color, + uint32_t stroke_color, int fill_mode, int alpha_flag, void* pIccTransform, @@ -201,7 +201,7 @@ FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData, m_pDeviceDriver->GetDriverType())) { CFX_GraphStateData graphState; graphState.m_LineWidth = 0.0f; - FX_DWORD strokecolor = fill_color; + uint32_t strokecolor = fill_color; if (bThin) { if (FXGETFLAG_COLORTYPE(alpha_flag)) { FXSETFLAG_ALPHA_STROKE(alpha_flag, fill_alpha >> 2); @@ -244,8 +244,8 @@ FX_BOOL CFX_RenderDevice::DrawFillStrokePath( const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState, - FX_DWORD fill_color, - FX_DWORD stroke_color, + uint32_t fill_color, + uint32_t stroke_color, int fill_mode, int alpha_flag, void* pIccTransform, @@ -302,7 +302,7 @@ FX_BOOL CFX_RenderDevice::DrawFillStrokePath( FX_BOOL CFX_RenderDevice::SetPixel(int x, int y, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform) { if (m_pDeviceDriver->SetPixel(x, y, color, alpha_flag, pIccTransform)) { @@ -312,7 +312,7 @@ FX_BOOL CFX_RenderDevice::SetPixel(int x, return FillRect(&rect, color, alpha_flag, pIccTransform); } FX_BOOL CFX_RenderDevice::FillRect(const FX_RECT* pRect, - FX_DWORD fill_color, + uint32_t fill_color, int alpha_flag, void* pIccTransform, int blend_type) { @@ -343,7 +343,7 @@ FX_BOOL CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, - FX_DWORD color, + uint32_t color, int fill_mode, int alpha_flag, void* pIccTransform, @@ -436,7 +436,7 @@ FX_BOOL CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, int top, int dest_width, int dest_height, - FX_DWORD flags, + uint32_t flags, void* pIccTransform, int blend_mode) { FX_RECT dest_rect(left, top, left + dest_width, top + dest_height); @@ -452,7 +452,7 @@ FX_BOOL CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, FX_BOOL CFX_RenderDevice::SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, - FX_DWORD argb, + uint32_t argb, int alpha_flag, void* pIccTransform) { FX_RECT src_rect(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight()); @@ -465,8 +465,8 @@ FX_BOOL CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int top, int dest_width, int dest_height, - FX_DWORD argb, - FX_DWORD flags, + uint32_t argb, + uint32_t flags, int alpha_flag, void* pIccTransform) { FX_RECT dest_rect(left, top, left + dest_width, top + dest_height); @@ -478,9 +478,9 @@ FX_BOOL CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, } FX_BOOL CFX_RenderDevice::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, - FX_DWORD argb, + uint32_t argb, const CFX_Matrix* pMatrix, - FX_DWORD flags, + uint32_t flags, void*& handle, int alpha_flag, void* pIccTransform, diff --git a/core/fxge/ge/fx_ge_font.cpp b/core/fxge/ge/fx_ge_font.cpp index b2c92f516d..04019a059c 100644 --- a/core/fxge/ge/fx_ge_font.cpp +++ b/core/fxge/ge/fx_ge_font.cpp @@ -13,7 +13,7 @@ namespace { #ifdef PDF_ENABLE_XFA -const FX_DWORD g_EncodingID[] = { +const uint32_t g_EncodingID[] = { FXFM_ENCODING_MS_SYMBOL, FXFM_ENCODING_UNICODE, FXFM_ENCODING_MS_SJIS, FXFM_ENCODING_MS_GB2312, FXFM_ENCODING_MS_BIG5, FXFM_ENCODING_MS_WANSUNG, @@ -24,7 +24,7 @@ const FX_DWORD g_EncodingID[] = { }; CFX_UnicodeEncodingEx* _FXFM_CreateFontEncoding(CFX_Font* pFont, - FX_DWORD nEncodingID) { + uint32_t nEncodingID) { if (FXFT_Select_Charmap(pFont->GetFace(), nEncodingID)) return nullptr; return new CFX_UnicodeEncodingEx(pFont, nEncodingID); @@ -127,7 +127,7 @@ void CFX_Font::DeleteFace() { } void CFX_Font::LoadSubst(const CFX_ByteString& face_name, FX_BOOL bTrueType, - FX_DWORD flags, + uint32_t flags, int weight, int italic_angle, int CharsetCP, @@ -213,7 +213,7 @@ FX_BOOL CFX_Font::LoadFile(IFX_FileRead* pFile, } #endif // PDF_ENABLE_XFA -int CFX_Font::GetGlyphWidth(FX_DWORD glyph_index) { +int CFX_Font::GetGlyphWidth(uint32_t glyph_index) { if (!m_Face) { return 0; } @@ -231,7 +231,7 @@ int CFX_Font::GetGlyphWidth(FX_DWORD glyph_index) { return width; } -FX_BOOL CFX_Font::LoadEmbedded(const uint8_t* data, FX_DWORD size) { +FX_BOOL CFX_Font::LoadEmbedded(const uint8_t* data, uint32_t size) { m_pFontDataAllocation = FX_Alloc(uint8_t, size); FXSYS_memcpy(m_pFontDataAllocation, data, size); m_Face = FT_LoadFont(m_pFontDataAllocation, size); @@ -261,7 +261,7 @@ int CFX_Font::GetDescent() const { FXFT_Get_Face_Descender(m_Face)); } -FX_BOOL CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT& bbox) { +FX_BOOL CFX_Font::GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox) { if (!m_Face) return FALSE; @@ -448,7 +448,7 @@ CFX_UnicodeEncoding::CFX_UnicodeEncoding(CFX_Font* pFont) : m_pFont(pFont) {} CFX_UnicodeEncoding::~CFX_UnicodeEncoding() {} -FX_DWORD CFX_UnicodeEncoding::GlyphFromCharCode(FX_DWORD charcode) { +uint32_t CFX_UnicodeEncoding::GlyphFromCharCode(uint32_t charcode) { FXFT_Face face = m_pFont->GetFace(); if (!face) return charcode; @@ -457,7 +457,7 @@ FX_DWORD CFX_UnicodeEncoding::GlyphFromCharCode(FX_DWORD charcode) { return FXFT_Get_Char_Index(face, charcode); if (m_pFont->GetSubstFont() && m_pFont->GetSubstFont()->m_Charset == 2) { - FX_DWORD index = 0; + uint32_t index = 0; if (FXFT_Select_Charmap(face, FXFT_ENCODING_MS_SYMBOL) == 0) index = FXFT_Get_Char_Index(face, charcode); if (!index && !FXFT_Select_Charmap(face, FXFT_ENCODING_APPLE_ROMAN)) @@ -468,12 +468,12 @@ FX_DWORD CFX_UnicodeEncoding::GlyphFromCharCode(FX_DWORD charcode) { #ifdef PDF_ENABLE_XFA CFX_UnicodeEncodingEx::CFX_UnicodeEncodingEx(CFX_Font* pFont, - FX_DWORD EncodingID) + uint32_t EncodingID) : CFX_UnicodeEncoding(pFont), m_nEncodingID(EncodingID) {} CFX_UnicodeEncodingEx::~CFX_UnicodeEncodingEx() {} -FX_DWORD CFX_UnicodeEncodingEx::GlyphFromCharCode(FX_DWORD charcode) { +uint32_t CFX_UnicodeEncodingEx::GlyphFromCharCode(uint32_t charcode) { FXFT_Face face = m_pFont->GetFace(); FT_UInt nIndex = FXFT_Get_Char_Index(face, charcode); if (nIndex > 0) { @@ -482,7 +482,7 @@ FX_DWORD CFX_UnicodeEncodingEx::GlyphFromCharCode(FX_DWORD charcode) { int nmaps = FXFT_Get_Face_CharmapCount(face); int m = 0; while (m < nmaps) { - FX_DWORD nEncodingID = + uint32_t nEncodingID = FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[m++]); if (m_nEncodingID == nEncodingID) { continue; @@ -501,7 +501,7 @@ FX_DWORD CFX_UnicodeEncodingEx::GlyphFromCharCode(FX_DWORD charcode) { return 0; } -FX_DWORD CFX_UnicodeEncodingEx::CharCodeFromUnicode(FX_WCHAR Unicode) const { +uint32_t CFX_UnicodeEncodingEx::CharCodeFromUnicode(FX_WCHAR Unicode) const { if (m_nEncodingID == FXFM_ENCODING_UNICODE || m_nEncodingID == FXFM_ENCODING_MS_SYMBOL) { return Unicode; @@ -516,11 +516,11 @@ FX_DWORD CFX_UnicodeEncodingEx::CharCodeFromUnicode(FX_WCHAR Unicode) const { return Unicode; } } - return static_cast<FX_DWORD>(-1); + return static_cast<uint32_t>(-1); } CFX_UnicodeEncodingEx* FX_CreateFontEncodingEx(CFX_Font* pFont, - FX_DWORD nEncodingID) { + uint32_t nEncodingID) { if (!pFont || !pFont->GetFace()) return nullptr; diff --git a/core/fxge/ge/fx_ge_fontmap.cpp b/core/fxge/ge/fx_ge_fontmap.cpp index 27b82f5803..709ef0031b 100644 --- a/core/fxge/ge/fx_ge_fontmap.cpp +++ b/core/fxge/ge/fx_ge_fontmap.cpp @@ -16,7 +16,7 @@ #define GET_TT_SHORT(w) (uint16_t)(((w)[0] << 8) | (w)[1]) #define GET_TT_LONG(w) \ - (FX_DWORD)(((w)[0] << 24) | ((w)[1] << 16) | ((w)[2] << 8) | (w)[3]) + (uint32_t)(((w)[0] << 24) | ((w)[1] << 16) | ((w)[2] << 8) | (w)[3]) #define FX_FONT_STYLE_None 0x00 #define FX_FONT_STYLE_Bold 0x01 @@ -27,7 +27,7 @@ namespace { struct BuiltinFont { const uint8_t* m_pFontData; - FX_DWORD m_dwSize; + uint32_t m_dwSize; }; const BuiltinFont g_FoxitFonts[14] = { @@ -211,8 +211,8 @@ const struct CODEPAGE_MAP { {10081, 86}, }; -const FX_DWORD kTableNAME = FXDWORD_GET_MSBFIRST("name"); -const FX_DWORD kTableTTCF = FXDWORD_GET_MSBFIRST("ttcf"); +const uint32_t kTableNAME = FXDWORD_GET_MSBFIRST("name"); +const uint32_t kTableTTCF = FXDWORD_GET_MSBFIRST("ttcf"); int CompareFontFamilyString(const void* key, const void* element) { CFX_ByteString str_key((const FX_CHAR*)key); @@ -237,7 +237,7 @@ CFX_ByteString KeyNameFromFace(const CFX_ByteString& face_name, return key; } -CFX_ByteString KeyNameFromSize(int ttc_size, FX_DWORD checksum) { +CFX_ByteString KeyNameFromSize(int ttc_size, uint32_t checksum) { CFX_ByteString key; key.Format("%d:%d", ttc_size, checksum); return key; @@ -256,7 +256,7 @@ CFX_ByteString TT_NormalizeName(const FX_CHAR* family) { return norm; } -CFX_ByteString FPDF_ReadStringFromFile(FXSYS_FILE* pFile, FX_DWORD size) { +CFX_ByteString FPDF_ReadStringFromFile(FXSYS_FILE* pFile, uint32_t size) { CFX_ByteString buffer; if (!FXSYS_fread(buffer.GetBuffer(size), size, 1, pFile)) { return CFX_ByteString(); @@ -267,13 +267,13 @@ CFX_ByteString FPDF_ReadStringFromFile(FXSYS_FILE* pFile, FX_DWORD size) { CFX_ByteString FPDF_LoadTableFromTT(FXSYS_FILE* pFile, const uint8_t* pTables, - FX_DWORD nTables, - FX_DWORD tag) { - for (FX_DWORD i = 0; i < nTables; i++) { + uint32_t nTables, + uint32_t tag) { + for (uint32_t i = 0; i < nTables; i++) { const uint8_t* p = pTables + i * 16; if (GET_TT_LONG(p) == tag) { - FX_DWORD offset = GET_TT_LONG(p + 8); - FX_DWORD size = GET_TT_LONG(p + 12); + uint32_t offset = GET_TT_LONG(p + 8); + uint32_t size = GET_TT_LONG(p + 12); FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET); return FPDF_ReadStringFromFile(pFile, size); } @@ -362,7 +362,7 @@ FX_BOOL CheckSupportThirdPartFont(CFX_ByteString name, int& PitchFamily) { return FALSE; } -FX_DWORD GetCharset(int charset) { +uint32_t GetCharset(int charset) { switch (charset) { case FXFONT_SHIFTJIS_CHARSET: return CHARSET_FLAG_SHIFTJIS; @@ -385,7 +385,7 @@ FX_DWORD GetCharset(int charset) { int32_t GetSimilarValue(int weight, FX_BOOL bItalic, int pitch_family, - FX_DWORD style) { + uint32_t style) { int32_t iSimilarValue = 0; if (!!(style & FXFONT_BOLD) == (weight > 400)) { iSimilarValue += 16; @@ -480,7 +480,7 @@ void CFX_FontMgr::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo) { FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, - FX_DWORD flags, + uint32_t flags, int weight, int italic_angle, int CharsetCP, @@ -507,7 +507,7 @@ FXFT_Face CFX_FontMgr::AddCachedFace(const CFX_ByteString& face_name, int weight, FX_BOOL bItalic, uint8_t* pData, - FX_DWORD size, + uint32_t size, int face_index) { CTTFontDesc* pFontDesc = new CTTFontDesc; pFontDesc->m_Type = 1; @@ -535,12 +535,12 @@ FXFT_Face CFX_FontMgr::AddCachedFace(const CFX_ByteString& face_name, } int GetTTCIndex(const uint8_t* pFontData, - FX_DWORD ttc_size, - FX_DWORD font_offset) { + uint32_t ttc_size, + uint32_t font_offset) { int face_index = 0; const uint8_t* p = pFontData + 8; - FX_DWORD nfont = GET_TT_LONG(p); - FX_DWORD index; + uint32_t nfont = GET_TT_LONG(p); + uint32_t index; for (index = 0; index < nfont; index++) { p = pFontData + 12 + index * 4; if (GET_TT_LONG(p) == font_offset) { @@ -555,7 +555,7 @@ int GetTTCIndex(const uint8_t* pFontData, return face_index; } FXFT_Face CFX_FontMgr::GetCachedTTCFace(int ttc_size, - FX_DWORD checksum, + uint32_t checksum, int font_offset, uint8_t*& pFontData) { auto it = m_FaceMap.find(KeyNameFromSize(ttc_size, checksum)); @@ -573,9 +573,9 @@ FXFT_Face CFX_FontMgr::GetCachedTTCFace(int ttc_size, return pFontDesc->m_TTCFace.m_pFaces[face_index]; } FXFT_Face CFX_FontMgr::AddCachedTTCFace(int ttc_size, - FX_DWORD checksum, + uint32_t checksum, uint8_t* pData, - FX_DWORD size, + uint32_t size, int font_offset) { CTTFontDesc* pFontDesc = new CTTFontDesc; pFontDesc->m_Type = 2; @@ -592,7 +592,7 @@ FXFT_Face CFX_FontMgr::AddCachedTTCFace(int ttc_size, } FXFT_Face CFX_FontMgr::GetFixedFace(const uint8_t* pData, - FX_DWORD size, + uint32_t size, int face_index) { InitFTLibrary(); FXFT_Library library = m_FTLibrary; @@ -633,7 +633,7 @@ void CFX_FontMgr::ReleaseFace(FXFT_Face face) { bool CFX_FontMgr::GetBuiltinFont(size_t index, const uint8_t** pFontData, - FX_DWORD* size) { + uint32_t* size) { if (index < FX_ArraySize(g_FoxitFonts)) { *pFontData = g_FoxitFonts[index].m_pFontData; *size = g_FoxitFonts[index].m_dwSize; @@ -682,7 +682,7 @@ void CFX_FontMapper::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo) { m_pFontInfo = pFontInfo; } static CFX_ByteString GetStringFromTable(const uint8_t* string_ptr, - FX_DWORD string_ptr_length, + uint32_t string_ptr_length, uint16_t offset, uint16_t length) { if (string_ptr_length < offset + length) { @@ -691,13 +691,13 @@ static CFX_ByteString GetStringFromTable(const uint8_t* string_ptr, return CFX_ByteStringC(string_ptr + offset, length); } CFX_ByteString GetNameFromTT(const uint8_t* name_table, - FX_DWORD name_table_size, - FX_DWORD name_id) { + uint32_t name_table_size, + uint32_t name_id) { if (!name_table || name_table_size < 6) { return CFX_ByteString(); } - FX_DWORD name_count = GET_TT_SHORT(name_table + 2); - FX_DWORD string_offset = GET_TT_SHORT(name_table + 4); + uint32_t name_count = GET_TT_SHORT(name_table + 2); + uint32_t string_offset = GET_TT_SHORT(name_table + 4); // We will ignore the possibility of overlap of structures and // string table as if it's all corrupt there's not a lot we can do. if (name_table_size < string_offset) { @@ -705,14 +705,14 @@ CFX_ByteString GetNameFromTT(const uint8_t* name_table, } const uint8_t* string_ptr = name_table + string_offset; - FX_DWORD string_ptr_size = name_table_size - string_offset; + uint32_t string_ptr_size = name_table_size - string_offset; name_table += 6; name_table_size -= 6; if (name_table_size < name_count * 12) { return CFX_ByteString(); } - for (FX_DWORD i = 0; i < name_count; i++, name_table += 12) { + for (uint32_t i = 0; i < name_count; i++, name_table += 12) { if (GET_TT_SHORT(name_table + 6) == name_id && GET_TT_SHORT(name_table) == 1 && GET_TT_SHORT(name_table + 2) == 0) { return GetStringFromTable(string_ptr, string_ptr_size, @@ -727,13 +727,13 @@ CFX_ByteString CFX_FontMapper::GetPSNameFromTT(void* hFont) { if (!m_pFontInfo) return CFX_ByteString(); - FX_DWORD size = m_pFontInfo->GetFontData(hFont, kTableNAME, nullptr, 0); + uint32_t size = m_pFontInfo->GetFontData(hFont, kTableNAME, nullptr, 0); if (!size) return CFX_ByteString(); std::vector<uint8_t> buffer(size); uint8_t* buffer_ptr = buffer.data(); - FX_DWORD bytes_read = + uint32_t bytes_read = m_pFontInfo->GetFontData(hFont, kTableNAME, buffer_ptr, size); return bytes_read == size ? GetNameFromTT(buffer_ptr, bytes_read, 6) : CFX_ByteString(); @@ -743,8 +743,8 @@ void CFX_FontMapper::AddInstalledFont(const CFX_ByteString& name, int charset) { if (!m_pFontInfo) { return; } - if (m_CharsetArray.Find((FX_DWORD)charset) == -1) { - m_CharsetArray.Add((FX_DWORD)charset); + if (m_CharsetArray.Find((uint32_t)charset) == -1) { + m_CharsetArray.Add((uint32_t)charset); m_FaceArray.push_back(name); } if (name == m_LastFamily) { @@ -820,7 +820,7 @@ FXFT_Face CFX_FontMapper::UseInternalSubst(CFX_SubstFont* pSubstFont, return m_FoxitFaces[iBaseFont]; } const uint8_t* pFontData = NULL; - FX_DWORD size = 0; + uint32_t size = 0; if (m_pFontMgr->GetBuiltinFont(iBaseFont, &pFontData, &size)) { m_FoxitFaces[iBaseFont] = m_pFontMgr->GetFixedFace(pFontData, size, 0); return m_FoxitFaces[iBaseFont]; @@ -838,7 +838,7 @@ FXFT_Face CFX_FontMapper::UseInternalSubst(CFX_SubstFont* pSubstFont, return m_MMFaces[1]; } const uint8_t* pFontData = NULL; - FX_DWORD size = 0; + uint32_t size = 0; m_pFontMgr->GetBuiltinFont(14, &pFontData, &size); m_MMFaces[1] = m_pFontMgr->GetFixedFace(pFontData, size, 0); return m_MMFaces[1]; @@ -848,7 +848,7 @@ FXFT_Face CFX_FontMapper::UseInternalSubst(CFX_SubstFont* pSubstFont, return m_MMFaces[0]; } const uint8_t* pFontData = NULL; - FX_DWORD size = 0; + uint32_t size = 0; m_pFontMgr->GetBuiltinFont(15, &pFontData, &size); m_MMFaces[0] = m_pFontMgr->GetFixedFace(pFontData, size, 0); return m_MMFaces[0]; @@ -856,7 +856,7 @@ FXFT_Face CFX_FontMapper::UseInternalSubst(CFX_SubstFont* pSubstFont, FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTrueType, - FX_DWORD flags, + uint32_t flags, int weight, int italic_angle, int WindowCP, @@ -881,7 +881,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, return m_FoxitFaces[12]; } const uint8_t* pFontData = NULL; - FX_DWORD size = 0; + uint32_t size = 0; m_pFontMgr->GetBuiltinFont(12, &pFontData, &size); m_FoxitFaces[12] = m_pFontMgr->GetFixedFace(pFontData, size, 0); return m_FoxitFaces[12]; @@ -894,7 +894,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, return m_FoxitFaces[13]; } const uint8_t* pFontData = NULL; - FX_DWORD size = 0; + uint32_t size = 0; m_pFontMgr->GetBuiltinFont(13, &pFontData, &size); m_FoxitFaces[13] = m_pFontMgr->GetFixedFace(pFontData, size, 0); return m_FoxitFaces[13]; @@ -918,7 +918,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, } int PitchFamily = 0; FX_BOOL bItalic = FALSE; - FX_DWORD nStyle = 0; + uint32_t nStyle = 0; FX_BOOL bStyleAvail = FALSE; if (iBaseFont < 12) { family = g_Base14FontNames[iBaseFont]; @@ -1139,7 +1139,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, return m_FoxitFaces[12]; } const uint8_t* pFontData = NULL; - FX_DWORD size = 0; + uint32_t size = 0; m_pFontMgr->GetBuiltinFont(12, &pFontData, &size); m_FoxitFaces[12] = m_pFontMgr->GetFixedFace(pFontData, size, 0); return m_FoxitFaces[12]; @@ -1170,8 +1170,8 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, if (Charset == FXFONT_DEFAULT_CHARSET) { m_pFontInfo->GetFontCharset(hFont, Charset); } - FX_DWORD ttc_size = m_pFontInfo->GetFontData(hFont, kTableTTCF, nullptr, 0); - FX_DWORD font_size = m_pFontInfo->GetFontData(hFont, 0, nullptr, 0); + uint32_t ttc_size = m_pFontInfo->GetFontData(hFont, kTableTTCF, nullptr, 0); + uint32_t font_size = m_pFontInfo->GetFontData(hFont, 0, nullptr, 0); if (font_size == 0 && ttc_size == 0) { m_pFontInfo->DeleteFont(hFont); return nullptr; @@ -1180,9 +1180,9 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, if (ttc_size) { uint8_t temp[1024]; m_pFontInfo->GetFontData(hFont, kTableTTCF, temp, 1024); - FX_DWORD checksum = 0; + uint32_t checksum = 0; for (int i = 0; i < 256; i++) { - checksum += ((FX_DWORD*)temp)[i]; + checksum += ((uint32_t*)temp)[i]; } uint8_t* pFontData; face = m_pFontMgr->GetCachedTTCFace(ttc_size, checksum, @@ -1239,8 +1239,8 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, return face; } #ifdef PDF_ENABLE_XFA -FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(FX_DWORD dwUnicode, - FX_DWORD flags, +FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(uint32_t dwUnicode, + uint32_t flags, int weight, int italic_angle) { if (m_pFontInfo == NULL) { @@ -1262,8 +1262,8 @@ FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(FX_DWORD dwUnicode, if (hFont == NULL) { return NULL; } - FX_DWORD ttc_size = m_pFontInfo->GetFontData(hFont, 0x74746366, NULL, 0); - FX_DWORD font_size = m_pFontInfo->GetFontData(hFont, 0, NULL, 0); + uint32_t ttc_size = m_pFontInfo->GetFontData(hFont, 0x74746366, NULL, 0); + uint32_t font_size = m_pFontInfo->GetFontData(hFont, 0, NULL, 0); if (font_size == 0 && ttc_size == 0) { m_pFontInfo->DeleteFont(hFont); return NULL; @@ -1272,9 +1272,9 @@ FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(FX_DWORD dwUnicode, if (ttc_size) { uint8_t temp[1024]; m_pFontInfo->GetFontData(hFont, 0x74746366, temp, 1024); - FX_DWORD checksum = 0; + uint32_t checksum = 0; for (int i = 0; i < 256; i++) { - checksum += ((FX_DWORD*)temp)[i]; + checksum += ((uint32_t*)temp)[i]; } uint8_t* pFontData; face = m_pFontMgr->GetCachedTTCFace(ttc_size, checksum, @@ -1308,7 +1308,7 @@ FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(FX_DWORD dwUnicode, return face; } -void* IFX_SystemFontInfo::MapFontByUnicode(FX_DWORD dwUnicode, +void* IFX_SystemFontInfo::MapFontByUnicode(uint32_t dwUnicode, int weight, FX_BOOL bItalic, int pitch_family) { @@ -1415,7 +1415,7 @@ void CFX_FolderFontInfo::ScanFile(const CFX_ByteString& path) { return; } FXSYS_fseek(pFile, 0, FXSYS_SEEK_END); - FX_DWORD filesize = FXSYS_ftell(pFile); + uint32_t filesize = FXSYS_ftell(pFile); uint8_t buffer[16]; FXSYS_fseek(pFile, 0, FXSYS_SEEK_SET); size_t readCnt = FXSYS_fread(buffer, 12, 1, pFile); @@ -1425,12 +1425,12 @@ void CFX_FolderFontInfo::ScanFile(const CFX_ByteString& path) { } if (GET_TT_LONG(buffer) == kTableTTCF) { - FX_DWORD nFaces = GET_TT_LONG(buffer + 8); - if (nFaces > std::numeric_limits<FX_DWORD>::max() / 4) { + uint32_t nFaces = GET_TT_LONG(buffer + 8); + if (nFaces > std::numeric_limits<uint32_t>::max() / 4) { FXSYS_fclose(pFile); return; } - FX_DWORD face_bytes = nFaces * 4; + uint32_t face_bytes = nFaces * 4; uint8_t* offsets = FX_Alloc(uint8_t, face_bytes); readCnt = FXSYS_fread(offsets, 1, face_bytes, pFile); if (readCnt != face_bytes) { @@ -1438,7 +1438,7 @@ void CFX_FolderFontInfo::ScanFile(const CFX_ByteString& path) { FXSYS_fclose(pFile); return; } - for (FX_DWORD i = 0; i < nFaces; i++) { + for (uint32_t i = 0; i < nFaces; i++) { uint8_t* p = offsets + i * 4; ReportFace(path, pFile, filesize, GET_TT_LONG(p)); } @@ -1450,14 +1450,14 @@ void CFX_FolderFontInfo::ScanFile(const CFX_ByteString& path) { } void CFX_FolderFontInfo::ReportFace(const CFX_ByteString& path, FXSYS_FILE* pFile, - FX_DWORD filesize, - FX_DWORD offset) { + uint32_t filesize, + uint32_t offset) { FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET); char buffer[16]; if (!FXSYS_fread(buffer, 12, 1, pFile)) { return; } - FX_DWORD nTables = GET_TT_SHORT(buffer + 4); + uint32_t nTables = GET_TT_SHORT(buffer + 4); CFX_ByteString tables = FPDF_ReadStringFromFile(pFile, nTables * 16); if (tables.IsEmpty()) { return; @@ -1483,7 +1483,7 @@ void CFX_FolderFontInfo::ReportFace(const CFX_ByteString& path, CFX_ByteString os2 = FPDF_LoadTableFromTT(pFile, tables, nTables, 0x4f532f32); if (os2.GetLength() >= 86) { const uint8_t* p = (const uint8_t*)os2 + 78; - FX_DWORD codepages = GET_TT_LONG(p); + uint32_t codepages = GET_TT_LONG(p); if (codepages & (1 << 17)) { m_pMapper->AddInstalledFont(facename, FXFONT_SHIFTJIS_CHARSET); pInfo->m_Charsets |= CHARSET_FLAG_SHIFTJIS; @@ -1540,7 +1540,7 @@ void* CFX_FolderFontInfo::FindFont(int weight, if (charset == FXFONT_ANSI_CHARSET && (pitch_family & FXFONT_FF_FIXEDPITCH)) { return GetFont("Courier New"); } - FX_DWORD charset_flag = GetCharset(charset); + uint32_t charset_flag = GetCharset(charset); int32_t iBestSimilar = 0; for (const auto& it : m_FontList) { const CFX_ByteString& bsName = it.first; @@ -1572,7 +1572,7 @@ void* CFX_FolderFontInfo::MapFont(int weight, } #ifdef PDF_ENABLE_XFA -void* CFX_FolderFontInfo::MapFontByUnicode(FX_DWORD dwUnicode, +void* CFX_FolderFontInfo::MapFontByUnicode(uint32_t dwUnicode, int weight, FX_BOOL bItalic, int pitch_family) { @@ -1585,23 +1585,23 @@ void* CFX_FolderFontInfo::GetFont(const FX_CHAR* face) { return it != m_FontList.end() ? it->second : nullptr; } -FX_DWORD CFX_FolderFontInfo::GetFontData(void* hFont, - FX_DWORD table, +uint32_t CFX_FolderFontInfo::GetFontData(void* hFont, + uint32_t table, uint8_t* buffer, - FX_DWORD size) { + uint32_t size) { if (!hFont) return 0; const CFX_FontFaceInfo* pFont = static_cast<CFX_FontFaceInfo*>(hFont); - FX_DWORD datasize = 0; - FX_DWORD offset = 0; + uint32_t datasize = 0; + uint32_t offset = 0; if (table == 0) { datasize = pFont->m_FontOffset ? 0 : pFont->m_FileSize; } else if (table == kTableTTCF) { datasize = pFont->m_FontOffset ? pFont->m_FileSize : 0; } else { - FX_DWORD nTables = pFont->m_FontTables.GetLength() / 16; - for (FX_DWORD i = 0; i < nTables; i++) { + uint32_t nTables = pFont->m_FontTables.GetLength() / 16; + for (uint32_t i = 0; i < nTables; i++) { const uint8_t* p = static_cast<const uint8_t*>(pFont->m_FontTables) + i * 16; if (GET_TT_LONG(p) == table) { diff --git a/core/fxge/ge/fx_ge_ps.cpp b/core/fxge/ge/fx_ge_ps.cpp index 2470025852..32f2fce914 100644 --- a/core/fxge/ge/fx_ge_ps.cpp +++ b/core/fxge/ge/fx_ge_ps.cpp @@ -11,7 +11,7 @@ struct PSGlyph { CFX_Font* m_pFont; - FX_DWORD m_GlyphIndex; + uint32_t m_GlyphIndex; FX_BOOL m_bGlyphAdjust; FX_FLOAT m_AdjustMatrix[4]; }; @@ -178,8 +178,8 @@ void CFX_PSRenderer::SetClip_PathStroke(const CFX_PathData* pPathData, FX_BOOL CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState, - FX_DWORD fill_color, - FX_DWORD stroke_color, + uint32_t fill_color, + uint32_t stroke_color, int fill_mode, int alpha_flag, void* pIccTransform) { @@ -275,7 +275,7 @@ static void FaxCompressData(uint8_t* src_buf, int width, int height, uint8_t*& dest_buf, - FX_DWORD& dest_size) { + uint32_t& dest_size) { CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule(); if (width * height > 128 && pEncoders && pEncoders->GetFaxModule()->Encode(src_buf, width, height, (width + 7) / 8, @@ -288,9 +288,9 @@ static void FaxCompressData(uint8_t* src_buf, } static void PSCompressData(int PSLevel, uint8_t* src_buf, - FX_DWORD src_size, + uint32_t src_size, uint8_t*& output_buf, - FX_DWORD& output_size, + uint32_t& output_size, const FX_CHAR*& filter) { output_buf = src_buf; output_size = src_size; @@ -300,7 +300,7 @@ static void PSCompressData(int PSLevel, } CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule(); uint8_t* dest_buf = NULL; - FX_DWORD dest_size = src_size; + uint32_t dest_size = src_size; if (PSLevel >= 3) { if (pEncoders && pEncoders->GetFlateModule()->Encode(src_buf, src_size, dest_buf, @@ -323,7 +323,7 @@ static void PSCompressData(int PSLevel, } } FX_BOOL CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, - FX_DWORD color, + uint32_t color, int left, int top, int alpha_flag, @@ -335,12 +335,12 @@ FX_BOOL CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, return DrawDIBits(pSource, color, &matrix, 0, alpha_flag, pIccTransform); } FX_BOOL CFX_PSRenderer::StretchDIBits(const CFX_DIBSource* pSource, - FX_DWORD color, + uint32_t color, int dest_left, int dest_top, int dest_width, int dest_height, - FX_DWORD flags, + uint32_t flags, int alpha_flag, void* pIccTransform) { StartRendering(); @@ -350,9 +350,9 @@ FX_BOOL CFX_PSRenderer::StretchDIBits(const CFX_DIBSource* pSource, return DrawDIBits(pSource, color, &matrix, flags, alpha_flag, pIccTransform); } FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, - FX_DWORD color, + uint32_t color, const CFX_Matrix* pMatrix, - FX_DWORD flags, + uint32_t flags, int alpha_flag, void* pIccTransform) { StartRendering(); @@ -377,14 +377,14 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, buf << width << " " << height; if (pSource->GetBPP() == 1 && !pSource->GetPalette()) { int pitch = (width + 7) / 8; - FX_DWORD src_size = height * pitch; + uint32_t src_size = height * pitch; uint8_t* src_buf = FX_Alloc(uint8_t, src_size); for (int row = 0; row < height; row++) { const uint8_t* src_scan = pSource->GetScanline(row); FXSYS_memcpy(src_buf + row * pitch, src_scan, pitch); } uint8_t* output_buf; - FX_DWORD output_size; + uint32_t output_size; FaxCompressData(src_buf, width, height, output_buf, output_size); if (pSource->IsAlphaMask()) { SetColor(color, alpha_flag, pIccTransform); @@ -469,7 +469,7 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, } } uint8_t* compressed_buf; - FX_DWORD compressed_size; + uint32_t compressed_size; PSCompressData(m_PSLevel, output_buf, output_size, compressed_buf, compressed_size, filter); if (output_buf != compressed_buf) { @@ -497,7 +497,7 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, OUTPUT_PS("\nQ\n"); return TRUE; } -void CFX_PSRenderer::SetColor(FX_DWORD color, +void CFX_PSRenderer::SetColor(uint32_t color, int alpha_flag, void* pIccTransform) { if (!CFX_GEModule::Get()->GetCodecModule() || @@ -646,7 +646,7 @@ FX_BOOL CFX_PSRenderer::DrawText(int nChars, CFX_FontCache* pCache, const CFX_Matrix* pObject2Device, FX_FLOAT font_size, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform) { StartRendering(); @@ -688,7 +688,7 @@ FX_BOOL CFX_PSRenderer::DrawText(int nChars, } void CFX_PSRenderer::WritePSBinary(const uint8_t* data, int len) { uint8_t* dest_buf; - FX_DWORD dest_size; + uint32_t dest_size; CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule(); if (pEncoders && pEncoders->GetBasicModule()->A85Encode(data, len, dest_buf, dest_size)) { diff --git a/core/fxge/ge/fx_ge_text.cpp b/core/fxge/ge/fx_ge_text.cpp index bcc630ca71..10c769aa6b 100644 --- a/core/fxge/ge/fx_ge_text.cpp +++ b/core/fxge/ge/fx_ge_text.cpp @@ -138,7 +138,7 @@ static const uint8_t g_TextGammaAdjust[256] = { #define ADJUST_ALPHA(background, foreground, src_alpha, text_flags, a) \ src_alpha = g_TextGammaAdjust[(uint8_t)src_alpha]; void _Color2Argb(FX_ARGB& argb, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform) { if (!pIccTransform && !FXGETFLAG_COLORTYPE(alpha_flag)) { @@ -177,8 +177,8 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, CFX_FontCache* pCache, FX_FLOAT font_size, const CFX_Matrix* pText2Device, - FX_DWORD fill_color, - FX_DWORD text_flags, + uint32_t fill_color, + uint32_t text_flags, int alpha_flag, void* pIccTransform) { int nativetext_flags = text_flags; @@ -1114,7 +1114,7 @@ FX_BOOL CFX_RenderDevice::DrawTextPath(int nChars, const CFX_Matrix* pText2User, const CFX_Matrix* pUser2Device, const CFX_GraphStateData* pGraphState, - FX_DWORD fill_color, + uint32_t fill_color, FX_ARGB stroke_color, CFX_PathData* pClippingPath, int nFlag, @@ -1256,7 +1256,7 @@ CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap( CFX_Font* pFont, const CFX_Matrix* pMatrix, CFX_ByteStringC& FaceGlyphsKey, - FX_DWORD glyph_index, + uint32_t glyph_index, FX_BOOL bFontStyle, int dest_width, int anti_alias) { @@ -1281,13 +1281,13 @@ CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap( return pGlyphBitmap; } const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, - FX_DWORD glyph_index, + uint32_t glyph_index, FX_BOOL bFontStyle, const CFX_Matrix* pMatrix, int dest_width, int anti_alias, int& text_flags) { - if (glyph_index == (FX_DWORD)-1) { + if (glyph_index == (uint32_t)-1) { return NULL; } _CFX_UniqueKeyGen keygen; @@ -1512,7 +1512,7 @@ static void _ContrastAdjust(uint8_t* pDataIn, } } CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, - FX_DWORD glyph_index, + uint32_t glyph_index, FX_BOOL bFontStyle, const CFX_Matrix* pMatrix, int dest_width, @@ -1647,12 +1647,12 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, return pGlyphBitmap; } const CFX_PathData* CFX_FaceCache::LoadGlyphPath(CFX_Font* pFont, - FX_DWORD glyph_index, + uint32_t glyph_index, int dest_width) { - if (!m_Face || glyph_index == (FX_DWORD)-1) + if (!m_Face || glyph_index == (uint32_t)-1) return nullptr; - FX_DWORD key = glyph_index; + uint32_t key = glyph_index; if (pFont->GetSubstFont()) { key += (((pFont->GetSubstFont()->m_Weight / 16) << 15) + ((pFont->GetSubstFont()->m_ItalicAngle / 2) << 21) + @@ -1792,7 +1792,7 @@ static int _Outline_CubicTo(const FXFT_Vector* control1, return 0; } }; -CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width) { +CFX_PathData* CFX_Font::LoadGlyphPath(uint32_t glyph_index, int dest_width) { if (!m_Face) { return NULL; } @@ -1868,8 +1868,8 @@ void _CFX_UniqueKeyGen::Generate(int count, ...) { va_start(argList, count); for (int i = 0; i < count; i++) { int p = va_arg(argList, int); - ((FX_DWORD*)m_Key)[i] = p; + ((uint32_t*)m_Key)[i] = p; } va_end(argList); - m_KeyLen = count * sizeof(FX_DWORD); + m_KeyLen = count * sizeof(uint32_t); } diff --git a/core/fxge/ge/fx_text_int.h b/core/fxge/ge/fx_text_int.h index d88b2a7cb9..04587c37cb 100644 --- a/core/fxge/ge/fx_text_int.h +++ b/core/fxge/ge/fx_text_int.h @@ -21,7 +21,7 @@ class CFX_SizeGlyphCache { public: CFX_SizeGlyphCache() {} ~CFX_SizeGlyphCache(); - std::map<FX_DWORD, CFX_GlyphBitmap*> m_GlyphMap; + std::map<uint32_t, CFX_GlyphBitmap*> m_GlyphMap; }; class CTTFontDesc { public: @@ -62,8 +62,8 @@ class CFX_FontFaceInfo { CFX_FontFaceInfo(CFX_ByteString filePath, CFX_ByteString faceName, CFX_ByteString fontTables, - FX_DWORD fontOffset, - FX_DWORD fileSize) + uint32_t fontOffset, + uint32_t fileSize) : m_FilePath(filePath), m_FaceName(faceName), m_FontTables(fontTables), @@ -75,10 +75,10 @@ class CFX_FontFaceInfo { const CFX_ByteString m_FilePath; const CFX_ByteString m_FaceName; const CFX_ByteString m_FontTables; - const FX_DWORD m_FontOffset; - const FX_DWORD m_FileSize; - FX_DWORD m_Styles; - FX_DWORD m_Charsets; + const uint32_t m_FontOffset; + const uint32_t m_FileSize; + uint32_t m_Styles; + uint32_t m_Charsets; }; #endif // CORE_FXGE_GE_FX_TEXT_INT_H_ diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index ed6ff82fd0..745c9b50fd 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -317,7 +317,7 @@ FX_BOOL CFX_SkiaDeviceDriver::DrawDeviceText(int nChars, CFX_FontCache* pCache, const CFX_Matrix* pObject2Device, FX_FLOAT font_size, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform) { SkAutoTUnref<SkTypeface> typeface(SkTypeface::CreateFromStream( @@ -430,8 +430,8 @@ FX_BOOL CFX_SkiaDeviceDriver::DrawPath( const CFX_PathData* pPathData, // path info const CFX_Matrix* pObject2Device, // optional transformation const CFX_GraphStateData* pGraphState, // graphic state, for pen attributes - FX_DWORD fill_color, // fill color - FX_DWORD stroke_color, // stroke color + uint32_t fill_color, // fill color + uint32_t stroke_color, // stroke color int fill_mode, // fill mode, WINDING or ALTERNATE. 0 for not filled int alpha_flag, void* pIccTransform, @@ -483,7 +483,7 @@ FX_BOOL CFX_SkiaDeviceDriver::DrawPath( } FX_BOOL CFX_SkiaDeviceDriver::FillRect(const FX_RECT* pRect, - FX_DWORD fill_color, + uint32_t fill_color, int alpha_flag, void* pIccTransform, int blend_type) { @@ -583,7 +583,7 @@ FX_BOOL CFX_SkiaDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, } FX_BOOL CFX_SkiaDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD argb, + uint32_t argb, const FX_RECT* pSrcRect, int left, int top, @@ -596,13 +596,13 @@ FX_BOOL CFX_SkiaDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, } FX_BOOL CFX_SkiaDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, - FX_DWORD argb, + uint32_t argb, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, - FX_DWORD flags, + uint32_t flags, int alpha_flag, void* pIccTransform, int blend_type) { @@ -614,9 +614,9 @@ FX_BOOL CFX_SkiaDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_BOOL CFX_SkiaDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, - FX_DWORD argb, + uint32_t argb, const CFX_Matrix* pMatrix, - FX_DWORD render_flags, + uint32_t render_flags, void*& handle, int alpha_flag, void* pIccTransform, diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h index 8ce7c6c61f..afc505da6e 100644 --- a/core/fxge/skia/fx_skia_device.h +++ b/core/fxge/skia/fx_skia_device.h @@ -50,15 +50,15 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { FX_BOOL DrawPath(const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState, - FX_DWORD fill_color, - FX_DWORD stroke_color, + uint32_t fill_color, + uint32_t stroke_color, int fill_mode, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) override; FX_BOOL FillRect(const FX_RECT* pRect, - FX_DWORD fill_color, + uint32_t fill_color, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) override; @@ -68,7 +68,7 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, - FX_DWORD color, + uint32_t color, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) override { @@ -87,7 +87,7 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { CFX_DIBitmap* GetBackDrop() override { return m_pAggDriver->GetBackDrop(); } FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD color, + uint32_t color, const FX_RECT* pSrcRect, int dest_left, int dest_top, @@ -95,22 +95,22 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { int alpha_flag = 0, void* pIccTransform = NULL) override; FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD color, + uint32_t color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, - FX_DWORD flags, + uint32_t flags, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) override; FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, - FX_DWORD color, + uint32_t color, const CFX_Matrix* pMatrix, - FX_DWORD flags, + uint32_t flags, void*& handle, int alpha_flag = 0, void* pIccTransform = NULL, @@ -124,7 +124,7 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { CFX_FontCache* pCache, const CFX_Matrix* pObject2Device, FX_FLOAT font_size, - FX_DWORD color, + uint32_t color, int alpha_flag = 0, void* pIccTransform = NULL) override; diff --git a/core/fxge/win32/dwrite_int.h b/core/fxge/win32/dwrite_int.h index 62672b2387..60cc981a48 100644 --- a/core/fxge/win32/dwrite_int.h +++ b/core/fxge/win32/dwrite_int.h @@ -37,7 +37,7 @@ class CDWriteExt { FX_BOOL IsAvailable() { return m_pDWriteFactory != NULL; } void* DwCreateFontFaceFromStream(uint8_t* pData, - FX_DWORD size, + uint32_t size, int simulation_style); FX_BOOL DwCreateRenderingTarget(CFX_DIBitmap* pSrc, void** renderTarget); void DwDeleteRenderingTarget(void* renderTarget); diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index 9b43fae09e..cb3f331d49 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -43,17 +43,17 @@ class CFX_Win32FontInfo final : public IFX_SystemFontInfo { const FX_CHAR* face, int& iExact) override; void* GetFont(const FX_CHAR* face) override { return NULL; } - FX_DWORD GetFontData(void* hFont, - FX_DWORD table, + uint32_t GetFontData(void* hFont, + uint32_t table, uint8_t* buffer, - FX_DWORD size) override; + uint32_t size) override; FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) override; FX_BOOL GetFontCharset(void* hFont, int& charset) override; void DeleteFont(void* hFont) override; FX_BOOL IsOpenTypeFromDiv(const LOGFONTA* plf); FX_BOOL IsSupportFontFormDiv(const LOGFONTA* plf); - void AddInstalledFont(const LOGFONTA* plf, FX_DWORD FontType); + void AddInstalledFont(const LOGFONTA* plf, uint32_t FontType); void GetGBPreference(CFX_ByteString& face, int weight, int picth_family); void GetJapanesePreference(CFX_ByteString& face, int weight, @@ -76,18 +76,18 @@ void CFX_Win32FontInfo::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) + (((uint32_t)x1 << 24) | ((uint32_t)x2 << 16) | ((uint32_t)x3 << 8) | \ + (uint32_t)x4) FX_BOOL CFX_Win32FontInfo::IsOpenTypeFromDiv(const LOGFONTA* plf) { HFONT hFont = CreateFontIndirectA(plf); 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; - GetFontData(hFont, 0, (uint8_t*)(&lVersion), sizeof(FX_DWORD)); - lVersion = (((FX_DWORD)(uint8_t)(lVersion)) << 24) | - ((FX_DWORD)((uint8_t)(lVersion >> 8))) << 16 | - ((FX_DWORD)((uint8_t)(lVersion >> 16))) << 8 | + uint32_t font_size = GetFontData(hFont, 0, NULL, 0); + if (font_size != GDI_ERROR && font_size >= sizeof(uint32_t)) { + uint32_t lVersion = 0; + GetFontData(hFont, 0, (uint8_t*)(&lVersion), sizeof(uint32_t)); + lVersion = (((uint32_t)(uint8_t)(lVersion)) << 24) | + ((uint32_t)((uint8_t)(lVersion >> 8))) << 16 | + ((uint32_t)((uint8_t)(lVersion >> 16))) << 8 | ((uint8_t)(lVersion >> 24)); if (lVersion == TT_MAKE_TAG('O', 'T', 'T', 'O') || lVersion == 0x00010000 || lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') || @@ -101,13 +101,13 @@ FX_BOOL CFX_Win32FontInfo::IsOpenTypeFromDiv(const LOGFONTA* plf) { FX_BOOL CFX_Win32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf) { HFONT hFont = CreateFontIndirectA(plf); 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; - GetFontData(hFont, 0, (uint8_t*)(&lVersion), sizeof(FX_DWORD)); - lVersion = (((FX_DWORD)(uint8_t)(lVersion)) << 24) | - ((FX_DWORD)((uint8_t)(lVersion >> 8))) << 16 | - ((FX_DWORD)((uint8_t)(lVersion >> 16))) << 8 | + uint32_t font_size = GetFontData(hFont, 0, NULL, 0); + if (font_size != GDI_ERROR && font_size >= sizeof(uint32_t)) { + uint32_t lVersion = 0; + GetFontData(hFont, 0, (uint8_t*)(&lVersion), sizeof(uint32_t)); + lVersion = (((uint32_t)(uint8_t)(lVersion)) << 24) | + ((uint32_t)((uint8_t)(lVersion >> 8))) << 16 | + ((uint32_t)((uint8_t)(lVersion >> 16))) << 8 | ((uint8_t)(lVersion >> 24)); if (lVersion == TT_MAKE_TAG('O', 'T', 'T', 'O') || lVersion == 0x00010000 || lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') || @@ -122,7 +122,7 @@ FX_BOOL CFX_Win32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf) { return ret; } void CFX_Win32FontInfo::AddInstalledFont(const LOGFONTA* plf, - FX_DWORD FontType) { + uint32_t FontType) { CFX_ByteString name(plf->lfFaceName); if (name[0] == '@') { return; @@ -144,7 +144,7 @@ void CFX_Win32FontInfo::AddInstalledFont(const LOGFONTA* plf, } static int CALLBACK FontEnumProc(const LOGFONTA* plf, const TEXTMETRICA* lpntme, - FX_DWORD FontType, + uint32_t FontType, LPARAM lParam) { CFX_Win32FontInfo* pFontInfo = (CFX_Win32FontInfo*)lParam; if (pFontInfo->m_pMapper->GetFontEnumerator()) { @@ -406,10 +406,10 @@ void* CFX_Win32FontInfo::MapFont(int weight, void CFX_Win32FontInfo::DeleteFont(void* hFont) { ::DeleteObject(hFont); } -FX_DWORD CFX_Win32FontInfo::GetFontData(void* hFont, - FX_DWORD table, +uint32_t CFX_Win32FontInfo::GetFontData(void* hFont, + uint32_t table, uint8_t* buffer, - FX_DWORD size) { + uint32_t size) { HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont); table = FXDWORD_GET_MSBFIRST(reinterpret_cast<uint8_t*>(&table)); size = ::GetFontData(m_hDC, table, 0, buffer, size); @@ -581,7 +581,7 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int dest_top, int dest_width, int dest_height, - FX_DWORD flags, + uint32_t flags, void* pIccTransform) { CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1; if (!pBitmap || dest_width == 0 || dest_height == 0) { @@ -624,8 +624,8 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchBitMask(const CFX_DIBitmap* pBitmap1, int dest_top, int dest_width, int dest_height, - FX_DWORD bitmap_color, - FX_DWORD flags, + uint32_t bitmap_color, + uint32_t flags, int alpha_flag, void* pIccTransform) { CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1; @@ -637,7 +637,7 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchBitMask(const CFX_DIBitmap* pBitmap1, int width = pBitmap->GetWidth(), height = pBitmap->GetHeight(); struct { BITMAPINFOHEADER bmiHeader; - FX_DWORD bmiColors[2]; + uint32_t bmiColors[2]; } bmi; FXSYS_memset(&bmi.bmiHeader, 0, sizeof(BITMAPINFOHEADER)); bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); @@ -691,7 +691,7 @@ FX_BOOL CGdiDeviceDriver::SetClipRgn(void* hRgn) { } static HPEN _CreatePen(const CFX_GraphStateData* pGraphState, const CFX_Matrix* pMatrix, - FX_DWORD argb) { + uint32_t argb) { FX_FLOAT width; FX_FLOAT scale = 1.f; if (pMatrix) @@ -703,7 +703,7 @@ static HPEN _CreatePen(const CFX_GraphStateData* pGraphState, } else { width = 1.0f; } - FX_DWORD PenStyle = PS_GEOMETRIC; + uint32_t PenStyle = PS_GEOMETRIC; if (width < 1) { width = 1; } @@ -741,9 +741,9 @@ static HPEN _CreatePen(const CFX_GraphStateData* pGraphState, lb.lbColor = rgb; lb.lbStyle = BS_SOLID; lb.lbHatch = 0; - FX_DWORD* pDash = NULL; + uint32_t* pDash = NULL; if (pGraphState->m_DashCount) { - pDash = FX_Alloc(FX_DWORD, pGraphState->m_DashCount); + pDash = FX_Alloc(uint32_t, pGraphState->m_DashCount); for (int i = 0; i < pGraphState->m_DashCount; i++) { pDash[i] = FXSYS_round( pMatrix ? pMatrix->TransformDistance(pGraphState->m_DashArray[i]) @@ -758,7 +758,7 @@ static HPEN _CreatePen(const CFX_GraphStateData* pGraphState, FX_Free(pDash); return hPen; } -static HBRUSH _CreateBrush(FX_DWORD argb) { +static HBRUSH _CreateBrush(uint32_t argb) { int a; FX_COLORREF rgb; ArgbDecode(argb, a, rgb); @@ -851,8 +851,8 @@ static FX_BOOL _MatrixNoScaled(const CFX_Matrix* pMatrix) { FX_BOOL CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, const CFX_Matrix* pMatrix, const CFX_GraphStateData* pGraphState, - FX_DWORD fill_color, - FX_DWORD stroke_color, + uint32_t fill_color, + uint32_t stroke_color, int fill_mode, int alpha_flag, void* pIccTransform, @@ -961,7 +961,7 @@ FX_BOOL CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, return TRUE; } FX_BOOL CGdiDeviceDriver::FillRect(const FX_RECT* pRect, - FX_DWORD fill_color, + uint32_t fill_color, int alpha_flag, void* pIccTransform, int blend_type) { @@ -1017,7 +1017,7 @@ FX_BOOL CGdiDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform, int blend_type) { @@ -1098,7 +1098,7 @@ FX_BOOL CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, return ret; } FX_BOOL CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource, - FX_DWORD color, + uint32_t color, const FX_RECT* pSrcRect, int left, int top, @@ -1152,7 +1152,7 @@ FX_BOOL CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource, return FALSE; } FX_BOOL CGdiDisplayDriver::UseFoxitStretchEngine(const CFX_DIBSource* pSource, - FX_DWORD color, + uint32_t color, int dest_left, int dest_top, int dest_width, @@ -1183,13 +1183,13 @@ FX_BOOL CGdiDisplayDriver::UseFoxitStretchEngine(const CFX_DIBSource* pSource, return ret; } FX_BOOL CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, - FX_DWORD color, + uint32_t color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, - FX_DWORD flags, + uint32_t flags, int alpha_flag, void* pIccTransform, int blend_type) { @@ -1265,7 +1265,7 @@ int GetPSLevel(HDC hDC) { if (device_type != DT_RASPRINTER) { return 0; } - FX_DWORD esc = GET_PS_FEATURESETTING; + uint32_t esc = GET_PS_FEATURESETTING; if (ExtEscape(hDC, QUERYESCSUPPORT, sizeof esc, (char*)&esc, 0, NULL)) { int param = FEATURESETTING_PSLEVEL; if (ExtEscape(hDC, GET_PS_FEATURESETTING, sizeof(int), (char*)¶m, @@ -1282,7 +1282,7 @@ int GetPSLevel(HDC hDC) { return 0; } esc = PSIDENT_GDICENTRIC; - if (ExtEscape(hDC, POSTSCRIPT_IDENTIFY, sizeof(FX_DWORD), (char*)&esc, 0, + if (ExtEscape(hDC, POSTSCRIPT_IDENTIFY, sizeof(uint32_t), (char*)&esc, 0, NULL) <= 0) { return 2; } diff --git a/core/fxge/win32/fx_win32_dib.cpp b/core/fxge/win32/fx_win32_dib.cpp index cd48d07554..cc627dbab0 100644 --- a/core/fxge/win32/fx_win32_dib.cpp +++ b/core/fxge/win32/fx_win32_dib.cpp @@ -27,7 +27,7 @@ CFX_ByteString CFX_WindowsDIB::GetBitmapInfo(const CFX_DIBitmap* pBitmap) { pbmih->biPlanes = 1; pbmih->biWidth = pBitmap->GetWidth(); if (pBitmap->GetBPP() == 8) { - FX_DWORD* pPalette = (FX_DWORD*)(pbmih + 1); + uint32_t* pPalette = (uint32_t*)(pbmih + 1); if (pBitmap->GetPalette()) { for (int i = 0; i < 256; i++) { pPalette[i] = pBitmap->GetPalette()[i]; @@ -39,7 +39,7 @@ CFX_ByteString CFX_WindowsDIB::GetBitmapInfo(const CFX_DIBitmap* pBitmap) { } } if (pBitmap->GetBPP() == 1) { - FX_DWORD* pPalette = (FX_DWORD*)(pbmih + 1); + uint32_t* pPalette = (uint32_t*)(pbmih + 1); if (pBitmap->GetPalette()) { pPalette[0] = pBitmap->GetPalette()[0]; pPalette[1] = pBitmap->GetPalette()[1]; @@ -88,11 +88,11 @@ CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, } if (pbmi->bmiHeader.biBitCount == 1) { for (int i = 0; i < 2; i++) { - pBitmap->SetPaletteEntry(i, ((FX_DWORD*)pbmi->bmiColors)[i] | 0xff000000); + pBitmap->SetPaletteEntry(i, ((uint32_t*)pbmi->bmiColors)[i] | 0xff000000); } } else if (pbmi->bmiHeader.biBitCount == 8) { for (int i = 0; i < 256; i++) { - pBitmap->SetPaletteEntry(i, ((FX_DWORD*)pbmi->bmiColors)[i] | 0xff000000); + pBitmap->SetPaletteEntry(i, ((uint32_t*)pbmi->bmiColors)[i] | 0xff000000); } } return pBitmap; @@ -182,8 +182,8 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadDIBitmap(WINDIB_Open_Args_ args) { } CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC, HBITMAP hBitmap, - FX_DWORD* pPalette, - FX_DWORD palsize) { + uint32_t* pPalette, + uint32_t palsize) { FX_BOOL bCreatedDC = !hDC; if (bCreatedDC) { hDC = CreateCompatibleDC(NULL); @@ -201,7 +201,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC, if (bmih.biBitCount == 1 || bmih.biBitCount == 8) { int size = sizeof(BITMAPINFOHEADER) + 8; if (bmih.biBitCount == 8) { - size += sizeof(FX_DWORD) * 254; + size += sizeof(uint32_t) * 254; } BITMAPINFO* pbmih = (BITMAPINFO*)FX_Alloc(uint8_t, size); pbmih->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); diff --git a/core/fxge/win32/fx_win32_dwrite.cpp b/core/fxge/win32/fx_win32_dwrite.cpp index 972295c5cc..f95b5eb4a3 100644 --- a/core/fxge/win32/fx_win32_dwrite.cpp +++ b/core/fxge/win32/fx_win32_dwrite.cpp @@ -127,7 +127,7 @@ CDWriteExt::~CDWriteExt() { Unload(); } LPVOID CDWriteExt::DwCreateFontFaceFromStream(uint8_t* pData, - FX_DWORD size, + uint32_t size, int simulation_style) { IDWriteFactory* pDwFactory = (IDWriteFactory*)m_pDWriteFactory; IDWriteFontFile* pDwFontFile = NULL; diff --git a/core/fxge/win32/fx_win32_gdipext.cpp b/core/fxge/win32/fx_win32_gdipext.cpp index 2fdfa3a8c7..b9c2190041 100644 --- a/core/fxge/win32/fx_win32_gdipext.cpp +++ b/core/fxge/win32/fx_win32_gdipext.cpp @@ -437,9 +437,9 @@ typedef HANDLE(__stdcall* FuncType_GdiAddFontMemResourceEx)(PVOID pbFont, DWORD* pcFonts); typedef BOOL(__stdcall* FuncType_GdiRemoveFontMemResourceEx)(HANDLE handle); void* CGdiplusExt::GdiAddFontMemResourceEx(void* pFontdata, - FX_DWORD size, + uint32_t size, void* pdv, - FX_DWORD* num_face) { + uint32_t* num_face) { if (m_pGdiAddFontMemResourceEx) { return ((FuncType_GdiAddFontMemResourceEx)m_pGdiAddFontMemResourceEx)( (PVOID)pFontdata, (DWORD)size, (PVOID)pdv, (DWORD*)num_face); @@ -711,7 +711,7 @@ void CGdiplusExt::Load() { GetProcAddress(m_GdiModule, "RemoveFontMemResourceEx"); } CGdiplusExt::~CGdiplusExt() {} -LPVOID CGdiplusExt::LoadMemFont(LPBYTE pData, FX_DWORD size) { +LPVOID CGdiplusExt::LoadMemFont(LPBYTE pData, uint32_t size) { GpFontCollection* pCollection = NULL; CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; @@ -809,7 +809,7 @@ void CGdiplusExt::GdipSetTextRenderingHint(void* graphics, int mode) { CallFunc(GdipSetTextRenderingHint)((GpGraphics*)graphics, (TextRenderingHint)mode); } -void CGdiplusExt::GdipSetPageUnit(void* graphics, FX_DWORD unit) { +void CGdiplusExt::GdipSetPageUnit(void* graphics, uint32_t unit) { CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; CallFunc(GdipSetPageUnit)((GpGraphics*)graphics, (GpUnit)unit); @@ -833,7 +833,7 @@ FX_BOOL CGdiplusExt::GdipDrawDriverString(void* graphics, } return FALSE; } -void CGdiplusExt::GdipCreateBrush(FX_DWORD fill_argb, void** pBrush) { +void CGdiplusExt::GdipCreateBrush(uint32_t fill_argb, void** pBrush) { CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; CallFunc(GdipCreateSolidFill)((ARGB)fill_argb, (GpSolidFill**)pBrush); @@ -916,7 +916,7 @@ FX_BOOL CGdiplusExt::StretchBitMask(HDC hDC, int dest_top, int dest_width, int dest_height, - FX_DWORD argb, + uint32_t argb, const FX_RECT* pClipRect, int flags) { ASSERT(pBitmap->GetBPP() == 1); @@ -1100,8 +1100,8 @@ FX_BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState, - FX_DWORD fill_argb, - FX_DWORD stroke_argb, + uint32_t fill_argb, + uint32_t stroke_argb, int fill_mode) { int nPoints = pPathData->GetPointCount(); if (nPoints == 0) { diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp index f7a1bb69a0..cb5ce771a3 100644 --- a/core/fxge/win32/fx_win32_print.cpp +++ b/core/fxge/win32/fx_win32_print.cpp @@ -34,7 +34,7 @@ int CGdiPrinterDriver::GetDeviceCaps(int caps_id) { return CGdiDeviceDriver::GetDeviceCaps(caps_id); } FX_BOOL CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, - FX_DWORD color, + uint32_t color, const FX_RECT* pSrcRect, int left, int top, @@ -62,13 +62,13 @@ FX_BOOL CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, return GDI_SetDIBits(pBitmap, pSrcRect, left, top, pIccTransform); } FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, - FX_DWORD color, + uint32_t color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, - FX_DWORD flags, + uint32_t flags, int alpha_flag, void* pIccTransform, int blend_type) { @@ -147,7 +147,7 @@ static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, } int src_width = pSrcBitmap->GetWidth(), src_height = pSrcBitmap->GetHeight(); uint8_t* src_buf = pSrcBitmap->GetBuffer(); - FX_DWORD src_pitch = pSrcBitmap->GetPitch(); + uint32_t src_pitch = pSrcBitmap->GetPitch(); FX_FLOAT dest_area = pDestMatrix->GetUnitArea(); FX_FLOAT area_scale = ((FX_FLOAT)(src_width * src_height)) / dest_area; FX_FLOAT size_scale = FXSYS_sqrt(area_scale); @@ -222,9 +222,9 @@ static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, } FX_BOOL CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, - FX_DWORD color, + uint32_t color, const CFX_Matrix* pMatrix, - FX_DWORD render_flags, + uint32_t render_flags, void*& handle, int alpha_flag, void* pIccTransform, @@ -330,7 +330,7 @@ FX_BOOL CPSPrinterDriver::Init(HDC hDC, int pslevel, FX_BOOL bCmykOutput) { if (ret) { CFX_PathData path; path.AllocPointCount(pData->rdh.nCount * 5); - for (FX_DWORD i = 0; i < pData->rdh.nCount; i++) { + for (uint32_t i = 0; i < pData->rdh.nCount; i++) { RECT* pRect = (RECT*)(pData->Buffer + pData->rdh.nRgnSize * i); path.AppendRect((FX_FLOAT)pRect->left, (FX_FLOAT)pRect->bottom, (FX_FLOAT)pRect->right, (FX_FLOAT)pRect->top); @@ -408,7 +408,7 @@ FX_BOOL CPSPrinterDriver::GetClipBox(FX_RECT* pRect) { return TRUE; } FX_BOOL CPSPrinterDriver::SetDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD color, + uint32_t color, const FX_RECT* pSrcRect, int left, int top, @@ -422,13 +422,13 @@ FX_BOOL CPSPrinterDriver::SetDIBits(const CFX_DIBSource* pBitmap, pIccTransform); } FX_BOOL CPSPrinterDriver::StretchDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD color, + uint32_t color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, - FX_DWORD flags, + uint32_t flags, int alpha_flag, void* pIccTransform, int blend_type) { @@ -441,9 +441,9 @@ FX_BOOL CPSPrinterDriver::StretchDIBits(const CFX_DIBSource* pBitmap, } FX_BOOL CPSPrinterDriver::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, - FX_DWORD color, + uint32_t color, const CFX_Matrix* pMatrix, - FX_DWORD render_flags, + uint32_t render_flags, void*& handle, int alpha_flag, void* pIccTransform, @@ -464,7 +464,7 @@ FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars, CFX_FontCache* pCache, const CFX_Matrix* pObject2Device, FX_FLOAT font_size, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform) { return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device, diff --git a/core/fxge/win32/win32_int.h b/core/fxge/win32/win32_int.h index d903d3abf5..18996afc5c 100644 --- a/core/fxge/win32/win32_int.h +++ b/core/fxge/win32/win32_int.h @@ -24,7 +24,7 @@ class CGdiplusExt { int dest_top, int dest_width, int dest_height, - FX_DWORD argb, + uint32_t argb, const FX_RECT* pClipRect, int flags); FX_BOOL StretchDIBits(HDC hDC, @@ -39,16 +39,16 @@ class CGdiplusExt { const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState, - FX_DWORD fill_argb, - FX_DWORD stroke_argb, + uint32_t fill_argb, + uint32_t stroke_argb, int fill_mode); - void* LoadMemFont(uint8_t* pData, FX_DWORD size); + void* LoadMemFont(uint8_t* pData, uint32_t size); void DeleteMemFont(void* pFontCollection); 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 GdipSetPageUnit(void* graphics, uint32_t unit); void GdipSetWorldTransform(void* graphics, void* pMatrix); FX_BOOL GdipDrawDriverString(void* graphics, unsigned short* text, @@ -58,7 +58,7 @@ class CGdiplusExt { void* positions, int flags, const void* matrix); - void GdipCreateBrush(FX_DWORD fill_argb, void** pBrush); + void GdipCreateBrush(uint32_t fill_argb, void** pBrush); void GdipDeleteBrush(void* pBrush); void GdipCreateMatrix(FX_FLOAT a, FX_FLOAT b, @@ -85,9 +85,9 @@ class CGdiplusExt { void GdipDisposeImage(void* bitmap); void GdipGetFontSize(void* pFont, FX_FLOAT* size); void* GdiAddFontMemResourceEx(void* pFontdata, - FX_DWORD size, + uint32_t size, void* pdv, - FX_DWORD* num_face); + uint32_t* num_face); FX_BOOL GdiRemoveFontMemResourceEx(void* handle); void* m_Functions[100]; void* m_pGdiAddFontMemResourceEx; @@ -125,14 +125,14 @@ class CGdiDeviceDriver : public IFX_RenderDeviceDriver { FX_BOOL DrawPath(const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState, - FX_DWORD fill_color, - FX_DWORD stroke_color, + uint32_t fill_color, + uint32_t stroke_color, int fill_mode, int alpha_flag, void* pIccTransform, int blend_type) override; FX_BOOL FillRect(const FX_RECT* pRect, - FX_DWORD fill_color, + uint32_t fill_color, int alpha_flag, void* pIccTransform, int blend_type) override; @@ -140,7 +140,7 @@ class CGdiDeviceDriver : public IFX_RenderDeviceDriver { FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform, int blend_type) override; @@ -162,15 +162,15 @@ class CGdiDeviceDriver : public IFX_RenderDeviceDriver { int dest_top, int dest_width, int dest_height, - FX_DWORD flags, + uint32_t flags, void* pIccTransform); 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, + uint32_t bitmap_color, + uint32_t flags, int alpha_flag, void* pIccTransform); HDC m_hDC; @@ -191,7 +191,7 @@ class CGdiDisplayDriver : public CGdiDeviceDriver { void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE) override; FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD color, + uint32_t color, const FX_RECT* pSrcRect, int left, int top, @@ -199,21 +199,21 @@ class CGdiDisplayDriver : public CGdiDeviceDriver { int alpha_flag, void* pIccTransform) override; FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD color, + uint32_t color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, - FX_DWORD flags, + uint32_t flags, int alpha_flag, void* pIccTransform, int blend_type) override; FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, - FX_DWORD color, + uint32_t color, const CFX_Matrix* pMatrix, - FX_DWORD render_flags, + uint32_t render_flags, void*& handle, int alpha_flag, void* pIccTransform, @@ -221,7 +221,7 @@ class CGdiDisplayDriver : public CGdiDeviceDriver { return FALSE; } FX_BOOL UseFoxitStretchEngine(const CFX_DIBSource* pSource, - FX_DWORD color, + uint32_t color, int dest_left, int dest_top, int dest_width, @@ -239,7 +239,7 @@ class CGdiPrinterDriver : public CGdiDeviceDriver { protected: int GetDeviceCaps(int caps_id) override; FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD color, + uint32_t color, const FX_RECT* pSrcRect, int left, int top, @@ -247,21 +247,21 @@ class CGdiPrinterDriver : public CGdiDeviceDriver { int alpha_flag, void* pIccTransform) override; FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD color, + uint32_t color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, - FX_DWORD flags, + uint32_t flags, int alpha_flag, void* pIccTransform, int blend_type) override; FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, - FX_DWORD color, + uint32_t color, const CFX_Matrix* pMatrix, - FX_DWORD render_flags, + uint32_t render_flags, void*& handle, int alpha_flag, void* pIccTransform, @@ -308,15 +308,15 @@ class CPSPrinterDriver : public IFX_RenderDeviceDriver { FX_BOOL DrawPath(const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState, - FX_DWORD fill_color, - FX_DWORD stroke_color, + uint32_t fill_color, + uint32_t stroke_color, int fill_mode, int alpha_flag, void* pIccTransform, int blend_type) override; FX_BOOL GetClipBox(FX_RECT* pRect) override; FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD color, + uint32_t color, const FX_RECT* pSrcRect, int left, int top, @@ -324,21 +324,21 @@ class CPSPrinterDriver : public IFX_RenderDeviceDriver { int alpha_flag, void* pIccTransform) override; FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, - FX_DWORD color, + uint32_t color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, - FX_DWORD flags, + uint32_t flags, int alpha_flag, void* pIccTransform, int blend_type) override; FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, - FX_DWORD color, + uint32_t color, const CFX_Matrix* pMatrix, - FX_DWORD render_flags, + uint32_t render_flags, void*& handle, int alpha_flag, void* pIccTransform, @@ -349,7 +349,7 @@ class CPSPrinterDriver : public IFX_RenderDeviceDriver { CFX_FontCache* pCache, const CFX_Matrix* pObject2Device, FX_FLOAT font_size, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform) override; void* GetPlatformSurface() const override { return (void*)m_hDC; } @@ -362,7 +362,7 @@ class CPSPrinterDriver : public IFX_RenderDeviceDriver { CFX_PSRenderer m_PSRenderer; }; void _Color2Argb(FX_ARGB& argb, - FX_DWORD color, + uint32_t color, int alpha_flag, void* pIccTransform); |