diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-09-26 16:24:49 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-27 01:04:13 +0000 |
commit | 698aed79d6ad6e8e3a0c7a500c108d69f944b82d (patch) | |
tree | fbf7e66e0a2ec096561cd0ba5d3c4d577cd64667 | |
parent | 3070e94f608f36e7312fad2d471e3d7546f82ca2 (diff) | |
download | pdfium-698aed79d6ad6e8e3a0c7a500c108d69f944b82d.tar.xz |
Cleanup FX macros
This CL renames the FX_OS defines to have _OS_ in their names and drops
the _DESKTOP suffix. The FXM defines have been changed to just FX.
Change-Id: Iab172fba541713b5f6d14fb8098baf68e3364c74
Reviewed-on: https://pdfium-review.googlesource.com/14833
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
79 files changed, 282 insertions, 283 deletions
diff --git a/core/fpdfapi/font/cpdf_cidfont.cpp b/core/fpdfapi/font/cpdf_cidfont.cpp index 9b326f5c4f..49413d24f5 100644 --- a/core/fpdfapi/font/cpdf_cidfont.cpp +++ b/core/fpdfapi/font/cpdf_cidfont.cpp @@ -125,7 +125,7 @@ CPDF_FontGlobals* GetFontGlobals() { return CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals(); } -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ bool IsValidEmbeddedCharcodeFromUnicodeCharset(CIDSet charset) { switch (charset) { @@ -174,7 +174,7 @@ uint32_t EmbeddedCharcodeFromUnicode(const FXCMAP_CMap* pEmbedMap, return 0; } -#endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ void FT_UseCIDCharmap(FXFT_Face face, int coding) { int encoding; @@ -260,7 +260,7 @@ wchar_t CPDF_CIDFont::GetUnicodeFromCharCode(uint32_t charcode) const { if (m_pCID2UnicodeMap && m_pCID2UnicodeMap->IsLoaded() && m_pCMap->IsLoaded()) return m_pCID2UnicodeMap->UnicodeFromCID(CIDFromCharCode(charcode)); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ wchar_t unicode; int charsize = 1; if (charcode > 255) { @@ -308,7 +308,7 @@ uint32_t CPDF_CIDFont::CharCodeFromUnicode(wchar_t unicode) const { return static_cast<uint32_t>(unicode); if (m_pCMap->m_Coding == CIDCODING_CID) return 0; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ uint8_t buffer[32]; int ret = FXSYS_WideCharToMultiByte( g_CharsetCPs[m_pCMap->m_Coding], 0, &unicode, 1, @@ -408,7 +408,7 @@ bool CPDF_CIDFont::Load() { m_pStreamAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pStream); m_pStreamAcc->LoadAllData(false); } else if (pmap->GetString() == "Identity") { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (m_pFontFile) m_bCIDIsGID = true; #else @@ -615,7 +615,7 @@ int CPDF_CIDFont::GlyphFromCharCode(uint32_t charcode, bool* pVertGlyph) { uint16_t cid = CIDFromCharCode(charcode); wchar_t unicode = 0; if (m_bCIDIsGID) { -#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ != _FX_PLATFORM_APPLE_ return cid; #else if (m_Flags & FXFONT_SYMBOLIC) @@ -680,7 +680,7 @@ int CPDF_CIDFont::GlyphFromCharCode(uint32_t charcode, bool* pVertGlyph) { if (m_Charset == CIDSET_JAPAN1) { if (unicode == '\\') { unicode = '/'; -#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ != _FX_PLATFORM_APPLE_ } else if (unicode == 0xa5) { unicode = 0x5c; #endif diff --git a/core/fpdfapi/font/cpdf_type1font.cpp b/core/fpdfapi/font/cpdf_type1font.cpp index a7ac264fe0..296351fc82 100644 --- a/core/fpdfapi/font/cpdf_type1font.cpp +++ b/core/fpdfapi/font/cpdf_type1font.cpp @@ -10,13 +10,13 @@ #include "core/fxge/cfx_gemodule.h" #include "core/fxge/fx_freetype.h" -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ #include "core/fxge/apple/apple_int.h" #endif namespace { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ struct GlyphNameMap { const char* m_pStrAdobe; const char* m_pStrUnicode; @@ -40,7 +40,7 @@ const char* GlyphNameRemap(const char* pStrAdobe) { return found ? found->m_pStrUnicode : nullptr; } -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ bool FT_UseType1Charmap(FXFT_Face face) { if (FXFT_Get_Face_CharmapCount(face) == 0) { @@ -114,7 +114,7 @@ void CPDF_Type1Font::LoadGlyphMap() { if (!m_Font.GetFace()) return; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ bool bCoreText = true; CQuartz2D& quartz2d = static_cast<CApplePlatform*>(CFX_GEModule::Get()->GetPlatformData()) @@ -138,7 +138,7 @@ void CPDF_Type1Font::LoadGlyphMap() { uint16_t unicode = prefix[j] * 256 + charcode; m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.GetFace(), unicode); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ CalcExtGID(charcode); #endif if (m_GlyphIndex[charcode]) { @@ -148,7 +148,7 @@ void CPDF_Type1Font::LoadGlyphMap() { } } if (bGotOne) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (!bCoreText) memcpy(m_ExtGID, m_GlyphIndex, 256); #endif @@ -168,25 +168,25 @@ void CPDF_Type1Font::LoadGlyphMap() { m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name); m_GlyphIndex[charcode] = FXFT_Get_Char_Index( m_Font.GetFace(), m_Encoding.m_Unicodes[charcode]); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ CalcExtGID(charcode); #endif if (m_GlyphIndex[charcode] == 0 && strcmp(name, ".notdef") == 0) { m_Encoding.m_Unicodes[charcode] = 0x20; m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.GetFace(), 0x20); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ CalcExtGID(charcode); #endif } } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (!bCoreText) memcpy(m_ExtGID, m_GlyphIndex, 256); #endif return; } FT_UseType1Charmap(m_Font.GetFace()); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (bCoreText) { if (m_Flags & FXFONT_SYMBOLIC) { for (int charcode = 0; charcode < 256; charcode++) { @@ -254,7 +254,7 @@ void CPDF_Type1Font::LoadGlyphMap() { } return; } -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (m_Flags & FXFONT_SYMBOLIC) { for (int charcode = 0; charcode < 256; charcode++) { const char* name = @@ -283,7 +283,7 @@ void CPDF_Type1Font::LoadGlyphMap() { } } } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (!bCoreText) memcpy(m_ExtGID, m_GlyphIndex, 256); @@ -312,13 +312,13 @@ void CPDF_Type1Font::LoadGlyphMap() { } } } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (!bCoreText) memcpy(m_ExtGID, m_GlyphIndex, 256); #endif } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ void CPDF_Type1Font::SetExtGID(const char* name, int charcode) { CFStringRef name_ct = CFStringCreateWithCStringNoCopy( kCFAllocatorDefault, name, kCFStringEncodingASCII, kCFAllocatorNull); @@ -335,4 +335,4 @@ void CPDF_Type1Font::CalcExtGID(int charcode) { name_glyph[255] = 0; SetExtGID(name_glyph, charcode); } -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ diff --git a/core/fpdfapi/font/cpdf_type1font.h b/core/fpdfapi/font/cpdf_type1font.h index 8039583d8e..76c4962ecb 100644 --- a/core/fpdfapi/font/cpdf_type1font.h +++ b/core/fpdfapi/font/cpdf_type1font.h @@ -29,7 +29,7 @@ class CPDF_Type1Font : public CPDF_SimpleFont { // CPDF_SimpleFont: void LoadGlyphMap() override; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ void SetExtGID(const char* name, int charcode); void CalcExtGID(int charcode); #endif diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp index fef031119f..6a8ddd1e1c 100644 --- a/core/fpdfapi/parser/cpdf_document.cpp +++ b/core/fpdfapi/parser/cpdf_document.cpp @@ -209,7 +209,7 @@ void InsertWidthArrayImpl(int* widths, int size, CPDF_Array* pWidthArray) { FX_Free(widths); } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ void InsertWidthArray(HDC hDC, int start, int end, CPDF_Array* pWidthArray) { int size = end - start + 1; int* widths = FX_Alloc(int, size); @@ -228,7 +228,7 @@ ByteString FPDF_GetPSNameFromTT(HDC hDC) { } return result; } -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ void InsertWidthArray1(CFX_Font* pFont, CFX_UnicodeEncoding* pEncoding, @@ -950,7 +950,7 @@ CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, bool bVert) { return LoadFont(pBaseDict); } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTW* pLogFont, bool bVert, bool bTranslateName) { @@ -1049,4 +1049,4 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont, DeleteDC(hDC); return LoadFont(pBaseDict); } -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h index c087254286..ab82c4a96a 100644 --- a/core/fpdfapi/parser/cpdf_document.h +++ b/core/fpdfapi/parser/cpdf_document.h @@ -95,7 +95,7 @@ class CPDF_Document : public CPDF_IndirectObjectHolder { CPDF_Font* AddStandardFont(const char* font, CPDF_FontEncoding* pEncoding); CPDF_Font* AddFont(CFX_Font* pFont, int charset, bool bVert); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ CPDF_Font* AddWindowsFont(LOGFONTA* pLogFont, bool bVert, bool bTranslateName = false); diff --git a/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp b/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp index 5df3348834..49a898f2ba 100644 --- a/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp +++ b/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp @@ -42,13 +42,13 @@ TEST_F(CPDFSecurityHandlerEmbeddertest, OwnerPassword) { } TEST_F(CPDFSecurityHandlerEmbeddertest, PasswordAfterGenerateSave) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ +#if _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ const char md5[] = "e4a3701ca5b2a759e06455aa8d97d46e"; -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const char md5[] = "6951b6c9891dfe0332a5b1983e484400"; #else const char md5[] = "50985f3440d3f66c3b599ab138214015"; -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ { ASSERT_TRUE(OpenDocument("encrypted.pdf", "5678", true)); FPDF_PAGE page = LoadPage(0); diff --git a/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp b/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp index 502e4666f7..bb186924b6 100644 --- a/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp +++ b/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp @@ -112,9 +112,9 @@ TEST_F(FPDFParserDecodeEmbeddertest, Bug_455199) { EXPECT_TRUE(OpenDocument("bug_455199.pdf")); FPDF_PAGE page = LoadPage(0); FPDF_BITMAP bitmap = RenderPage(page); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const char kExpectedMd5sum[] = "b90475ca64d1348c3bf5e2b77ad9187a"; -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ const char kExpectedMd5sum[] = "9a2637b73fd5265309bfddd9c69476cd"; #else const char kExpectedMd5sum[] = "f7e129d97c58e91adeace32a4327b925"; diff --git a/core/fpdfapi/render/cpdf_charposlist.cpp b/core/fpdfapi/render/cpdf_charposlist.cpp index f286474dd8..16fb3c140c 100644 --- a/core/fpdfapi/render/cpdf_charposlist.cpp +++ b/core/fpdfapi/render/cpdf_charposlist.cpp @@ -41,7 +41,7 @@ void CPDF_CharPosList::Load(const std::vector<uint32_t>& charCodes, charpos.m_Unicode = !unicode.IsEmpty() ? unicode[0] : CharCode; charpos.m_GlyphIndex = pFont->GlyphFromCharCode(CharCode, &bVert); uint32_t GlyphID = charpos.m_GlyphIndex; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ charpos.m_ExtGID = pFont->GlyphFromCharCodeExt(CharCode); GlyphID = charpos.m_ExtGID; #endif @@ -55,7 +55,7 @@ void CPDF_CharPosList::Load(const std::vector<uint32_t>& charCodes, charpos.m_GlyphIndex = pFont->FallbackGlyphFromCharcode( charpos.m_FallbackFontPosition, CharCode); pCurrentFont = pFont->GetFontFallback(charpos.m_FallbackFontPosition); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ charpos.m_ExtGID = charpos.m_GlyphIndex; #endif } diff --git a/core/fpdfapi/render/cpdf_devicebuffer.cpp b/core/fpdfapi/render/cpdf_devicebuffer.cpp index b632dee49d..90301b2e56 100644 --- a/core/fpdfapi/render/cpdf_devicebuffer.cpp +++ b/core/fpdfapi/render/cpdf_devicebuffer.cpp @@ -28,7 +28,7 @@ bool CPDF_DeviceBuffer::Initialize(CPDF_RenderContext* pContext, m_Rect = *pRect; m_pObject = pObj; m_Matrix.Translate(-pRect->left, -pRect->top); -#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ != _FX_PLATFORM_APPLE_ int horz_size = pDevice->GetDeviceCaps(FXDC_HORZ_SIZE); int vert_size = pDevice->GetDeviceCaps(FXDC_VERT_SIZE); if (horz_size && vert_size && max_dpi) { diff --git a/core/fpdfapi/render/cpdf_dibtransferfunc.cpp b/core/fpdfapi/render/cpdf_dibtransferfunc.cpp index be2c9f30bb..d72ad48cf1 100644 --- a/core/fpdfapi/render/cpdf_dibtransferfunc.cpp +++ b/core/fpdfapi/render/cpdf_dibtransferfunc.cpp @@ -25,7 +25,7 @@ FXDIB_Format CPDF_DIBTransferFunc::GetDestFormat() { if (m_pSrc->IsAlphaMask()) return FXDIB_8bppMask; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb32; #else return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb; @@ -59,7 +59,7 @@ void CPDF_DIBTransferFunc::TranslateScanline( (*dest_buf)[index++] = g0; (*dest_buf)[index++] = r0; } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ index++; #endif } @@ -93,7 +93,7 @@ void CPDF_DIBTransferFunc::TranslateScanline( (*dest_buf)[index++] = m_RampR[src_byte]; } src_buf++; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ index++; #endif } @@ -111,7 +111,7 @@ void CPDF_DIBTransferFunc::TranslateScanline( (*dest_buf)[index++] = m_RampB[*(src_buf++)]; (*dest_buf)[index++] = m_RampG[*(src_buf++)]; (*dest_buf)[index++] = m_RampR[*(src_buf++)]; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ index++; #endif } @@ -127,7 +127,7 @@ void CPDF_DIBTransferFunc::TranslateScanline( (*dest_buf)[index++] = m_RampR[*(src_buf++)]; if (!bSkip) { (*dest_buf)[index++] = *src_buf; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ } else { index++; #endif @@ -155,7 +155,7 @@ void CPDF_DIBTransferFunc::TranslateDownSamples(uint8_t* dest_buf, *dest_buf++ = m_RampR[*(src_buf++)]; } } else { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (!m_pSrc->HasAlpha()) { for (int i = 0; i < pixels; i++) { *dest_buf++ = m_RampB[*(src_buf++)]; @@ -172,7 +172,7 @@ void CPDF_DIBTransferFunc::TranslateDownSamples(uint8_t* dest_buf, *dest_buf++ = m_RampR[*(src_buf++)]; *dest_buf++ = *(src_buf++); } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ } #endif } diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp index 8cc91e470d..b49394993a 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/core/fpdfapi/render/cpdf_renderstatus.cpp @@ -2551,7 +2551,7 @@ RetainPtr<CFX_DIBitmap> CPDF_RenderStatus::LoadSMask( int width = pClipRect->right - pClipRect->left; int height = pClipRect->bottom - pClipRect->top; FXDIB_Format format; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || defined _SKIA_SUPPORT_ || \ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ || defined _SKIA_SUPPORT_ || \ defined _SKIA_SUPPORT_PATHS_ format = bLuminosity ? FXDIB_Rgb32 : FXDIB_8bppMask; #else diff --git a/core/fpdfdoc/cpdf_filespec.cpp b/core/fpdfdoc/cpdf_filespec.cpp index 803c4148c7..2f999bcf4e 100644 --- a/core/fpdfdoc/cpdf_filespec.cpp +++ b/core/fpdfdoc/cpdf_filespec.cpp @@ -18,13 +18,13 @@ namespace { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || \ - _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ || \ + _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ WideString ChangeSlashToPlatform(const wchar_t* str) { WideString result; while (*str) { if (*str == '/') { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ result += L':'; #else result += L'\\'; @@ -49,7 +49,7 @@ WideString ChangeSlashToPDF(const wchar_t* str) { } return result; } -#endif // _FXM_PLATFORM_APPLE_ || _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_APPLE_ || _FX_PLATFORM_WINDOWS_ } // namespace @@ -63,11 +63,11 @@ WideString CPDF_FileSpec::DecodeFileName(const WideString& filepath) { if (filepath.GetLength() <= 1) return WideString(); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (filepath.Left(sizeof("/Mac") - 1) == WideStringView(L"/Mac")) return ChangeSlashToPlatform(filepath.c_str() + 1); return ChangeSlashToPlatform(filepath.c_str()); -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ if (filepath[0] != L'/') return ChangeSlashToPlatform(filepath.c_str()); @@ -157,7 +157,7 @@ WideString CPDF_FileSpec::EncodeFileName(const WideString& filepath) { if (filepath.GetLength() <= 1) return WideString(); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ if (filepath[1] == L':') { WideString result(L'/'); result += filepath[0]; @@ -173,7 +173,7 @@ WideString CPDF_FileSpec::EncodeFileName(const WideString& filepath) { if (filepath[0] == L'\\') return L'/' + ChangeSlashToPDF(filepath.c_str()); return ChangeSlashToPDF(filepath.c_str()); -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (filepath.Left(sizeof("Mac") - 1) == L"Mac") return L'/' + ChangeSlashToPDF(filepath.c_str()); return ChangeSlashToPDF(filepath.c_str()); diff --git a/core/fpdfdoc/cpdf_filespec_unittest.cpp b/core/fpdfdoc/cpdf_filespec_unittest.cpp index 8d151c9dd8..5537473e2c 100644 --- a/core/fpdfdoc/cpdf_filespec_unittest.cpp +++ b/core/fpdfdoc/cpdf_filespec_unittest.cpp @@ -22,7 +22,7 @@ TEST(cpdf_filespec, EncodeDecodeFileName) { {L"", L""}, // only file name. {L"test.pdf", L"test.pdf"}, -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ // With drive identifier. {L"r:\\pdfdocs\\spec.pdf", L"/r/pdfdocs/spec.pdf"}, // Relative path. @@ -33,7 +33,7 @@ TEST(cpdf_filespec, EncodeDecodeFileName) { {L"\\\\pdfdocs\\spec.pdf", L"/pdfdocs/spec.pdf"}, // Network resource name. It is not supported yet. // {L"pclib/eng:\\pdfdocs\\spec.pdf", L"/pclib/eng/pdfdocs/spec.pdf"}, -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ // Absolute path with colon separator. {L"Mac HD:PDFDocs:spec.pdf", L"/Mac HD/PDFDocs/spec.pdf"}, // Relative path with colon separator. @@ -60,10 +60,10 @@ TEST(cpdf_filespec, GetFileName) { { // String object. pdfium::NullTermWstrFuncTestData test_data = { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ L"/C/docs/test.pdf", L"C:\\docs\\test.pdf" -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ L"/Mac HD/docs/test.pdf", L"Mac HD:docs:test.pdf" #else @@ -78,13 +78,13 @@ TEST(cpdf_filespec, GetFileName) { { // Dictionary object. pdfium::NullTermWstrFuncTestData test_data[5] = { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ {L"/C/docs/test.pdf", L"C:\\docs\\test.pdf"}, {L"/D/docs/test.pdf", L"D:\\docs\\test.pdf"}, {L"/E/docs/test.pdf", L"E:\\docs\\test.pdf"}, {L"/F/docs/test.pdf", L"F:\\docs\\test.pdf"}, {L"/G/docs/test.pdf", L"G:\\docs\\test.pdf"}, -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ {L"/Mac HD/docs1/test.pdf", L"Mac HD:docs1:test.pdf"}, {L"/Mac HD/docs2/test.pdf", L"Mac HD:docs2:test.pdf"}, {L"/Mac HD/docs3/test.pdf", L"Mac HD:docs3:test.pdf"}, @@ -123,10 +123,10 @@ TEST(cpdf_filespec, GetFileName) { TEST(cpdf_filespec, SetFileName) { pdfium::NullTermWstrFuncTestData test_data = { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ L"C:\\docs\\test.pdf", L"/C/docs/test.pdf" -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ L"Mac HD:docs:test.pdf", L"/Mac HD/docs/test.pdf" #else diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp index 3bbb50b9ec..f17e543e70 100644 --- a/core/fpdfdoc/cpdf_interform.cpp +++ b/core/fpdfdoc/cpdf_interform.cpp @@ -322,7 +322,7 @@ class CFieldNameExtractor { const wchar_t* m_pEnd; }; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ typedef struct { bool bFind; LOGFONTA lf; @@ -368,7 +368,7 @@ bool RetrieveSpecificFont(uint8_t charSet, } return RetrieveSpecificFont(lf); } -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ int CompareFieldName(const WideString& name1, const WideString& name2) { const wchar_t* ptr1 = name1.c_str(); @@ -578,7 +578,7 @@ CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, // static uint8_t CPDF_InterForm::GetNativeCharSet() { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ uint8_t charSet = FX_CHARSET_ANSI; UINT iCodePage = ::GetACP(); switch (iCodePage) { @@ -738,7 +738,7 @@ CPDF_Font* CPDF_InterForm::AddStandardFont(CPDF_Document* pDocument, ByteString CPDF_InterForm::GetNativeFont(uint8_t charSet, void* pLogFont) { ByteString csFontName; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ LOGFONTA lf = {}; if (charSet == FX_CHARSET_ANSI) { csFontName = "Helvetica"; @@ -783,7 +783,7 @@ CPDF_Font* CPDF_InterForm::AddNativeFont(uint8_t charSet, if (!pDocument) return nullptr; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ LOGFONTA lf; ByteString csFontName = GetNativeFont(charSet, &lf); if (!csFontName.IsEmpty()) { diff --git a/core/fxcodec/codec/ccodec_faxmodule.h b/core/fxcodec/codec/ccodec_faxmodule.h index 92e45e6719..58889d142b 100644 --- a/core/fxcodec/codec/ccodec_faxmodule.h +++ b/core/fxcodec/codec/ccodec_faxmodule.h @@ -26,7 +26,7 @@ class CCodec_FaxModule { bool BlackIs1, int Columns, int Rows); -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#if _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ static void FaxEncode(const uint8_t* src_buf, int width, int height, diff --git a/core/fxcodec/codec/ccodec_jpegmodule.h b/core/fxcodec/codec/ccodec_jpegmodule.h index d7e484d56f..cc59924747 100644 --- a/core/fxcodec/codec/ccodec_jpegmodule.h +++ b/core/fxcodec/codec/ccodec_jpegmodule.h @@ -57,7 +57,7 @@ class CCodec_JpegModule { bool ReadScanline(Context* pContext, uint8_t* dest_buf); uint32_t GetAvailInput(Context* pContext, uint8_t** avail_buf_ptr); -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#if _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ static bool JpegEncode(const RetainPtr<CFX_DIBSource>& pSource, uint8_t** dest_buf, FX_STRSIZE* dest_size); diff --git a/core/fxcodec/codec/fx_codec_fax.cpp b/core/fxcodec/codec/fx_codec_fax.cpp index 9c8eaa25ce..83ff5f7b3a 100644 --- a/core/fxcodec/codec/fx_codec_fax.cpp +++ b/core/fxcodec/codec/fx_codec_fax.cpp @@ -607,7 +607,7 @@ std::unique_ptr<CCodec_ScanlineDecoder> CCodec_FaxModule::CreateDecoder( EncodedByteAlign, BlackIs1); } -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#if _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ namespace { const uint8_t BlackRunTerminator[128] = { 0x37, 10, 0x02, 3, 0x03, 2, 0x02, 2, 0x03, 3, 0x03, 4, 0x02, 4, diff --git a/core/fxcodec/codec/fx_codec_jpeg.cpp b/core/fxcodec/codec/fx_codec_jpeg.cpp index ea32f00a2e..b77fc87394 100644 --- a/core/fxcodec/codec/fx_codec_jpeg.cpp +++ b/core/fxcodec/codec/fx_codec_jpeg.cpp @@ -88,7 +88,7 @@ static void _error_do_nothing1(j_common_ptr cinfo, int) {} static void _error_do_nothing2(j_common_ptr cinfo, char*) {} -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#if _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ static void _dest_do_nothing(j_compress_ptr cinfo) {} static boolean _dest_empty(j_compress_ptr cinfo) { @@ -506,7 +506,7 @@ uint32_t CCodec_JpegModule::GetAvailInput(Context* pContext, return (uint32_t)ctx->m_SrcMgr.bytes_in_buffer; } -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#if _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ #define JPEG_BLOCK_SIZE 1048576 bool CCodec_JpegModule::JpegEncode(const RetainPtr<CFX_DIBSource>& pSource, uint8_t** dest_buf, diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp index d93d46d57a..d28277173e 100644 --- a/core/fxcodec/codec/fx_codec_progress.cpp +++ b/core/fxcodec/codec/fx_codec_progress.cpp @@ -22,11 +22,11 @@ namespace { -#if _FX_OS_ == _FX_MACOSX_ +#if _FX_OS_ == _FX_OS_MACOSX_ const double kPngGamma = 1.7; -#else // _FX_OS_ == _FX_MACOSX_ +#else // _FX_OS_ == _FX_OS_MACOSX_ const double kPngGamma = 2.2; -#endif // _FX_OS_ == _FX_MACOSX_ +#endif // _FX_OS_ == _FX_OS_MACOSX_ void RGB2BGR(uint8_t* buffer, int width = 1) { if (buffer && width > 0) { diff --git a/core/fxcrt/cfx_datetime.cpp b/core/fxcrt/cfx_datetime.cpp index beba3654a4..521e07cb67 100644 --- a/core/fxcrt/cfx_datetime.cpp +++ b/core/fxcrt/cfx_datetime.cpp @@ -7,8 +7,8 @@ #include "core/fxcrt/cfx_datetime.h" #include "core/fxcrt/fx_system.h" -#if _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_ANDROID_ || \ - _FX_OS_ == _FX_MACOSX_ +#if _FX_OS_ == _FX_OS_LINUX_ || _FX_OS_ == _FX_OS_ANDROID_ || \ + _FX_OS_ == _FX_OS_MACOSX_ #include <sys/time.h> #include <time.h> #endif @@ -92,9 +92,9 @@ bool FX_IsLeapYear(int32_t iYear) { void CFX_DateTime::Now() { FXUT_SYSTEMTIME utLocal; -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#if _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ ::GetLocalTime((LPSYSTEMTIME)&utLocal); -#else // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#else // _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ timeval curTime; gettimeofday(&curTime, nullptr); @@ -108,7 +108,7 @@ void CFX_DateTime::Now() { utLocal.wMinute = st.tm_min; utLocal.wSecond = st.tm_sec; utLocal.wMillisecond = curTime.tv_usec / 1000; -#endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#endif // _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ year_ = utLocal.wYear; month_ = static_cast<uint8_t>(utLocal.wMonth); diff --git a/core/fxcrt/cfx_datetime.h b/core/fxcrt/cfx_datetime.h index 272c2496cc..28991103f5 100644 --- a/core/fxcrt/cfx_datetime.h +++ b/core/fxcrt/cfx_datetime.h @@ -91,14 +91,14 @@ class CFX_DateTime { uint16_t millisecond_; }; -#if _FX_OS_ != _FX_ANDROID_ +#if _FX_OS_ != _FX_OS_ANDROID_ #pragma pack(push, 1) #endif struct FX_TIMEZONE { int8_t tzHour; uint8_t tzMinute; }; -#if _FX_OS_ != _FX_ANDROID_ +#if _FX_OS_ != _FX_OS_ANDROID_ #pragma pack(pop) #endif diff --git a/core/fxcrt/cfx_fileaccess_posix.cpp b/core/fxcrt/cfx_fileaccess_posix.cpp index d98e58dbe9..2f85670c59 100644 --- a/core/fxcrt/cfx_fileaccess_posix.cpp +++ b/core/fxcrt/cfx_fileaccess_posix.cpp @@ -18,9 +18,9 @@ #define O_LARGEFILE 0 #endif // O_LARGEFILE -#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ || \ - _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || \ - _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ +#if _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ || \ + _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ || \ + _FX_PLATFORM_ == _FX_PLATFORM_ANDROID_ namespace { diff --git a/core/fxcrt/cfx_fileaccess_posix.h b/core/fxcrt/cfx_fileaccess_posix.h index 0b739e72d8..efa25ebb4c 100644 --- a/core/fxcrt/cfx_fileaccess_posix.h +++ b/core/fxcrt/cfx_fileaccess_posix.h @@ -9,9 +9,9 @@ #include "core/fxcrt/ifx_fileaccess.h" -#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ || \ - _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || \ - _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ +#if _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ || \ + _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ || \ + _FX_PLATFORM_ == _FX_PLATFORM_ANDROID_ class CFX_FileAccess_Posix : public IFX_FileAccess { public: CFX_FileAccess_Posix(); diff --git a/core/fxcrt/cfx_fileaccess_windows.cpp b/core/fxcrt/cfx_fileaccess_windows.cpp index 105ad788f7..1ac4496edb 100644 --- a/core/fxcrt/cfx_fileaccess_windows.cpp +++ b/core/fxcrt/cfx_fileaccess_windows.cpp @@ -11,7 +11,7 @@ #include "core/fxcrt/fx_string.h" #include "third_party/base/ptr_util.h" -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ namespace { diff --git a/core/fxcrt/cfx_fileaccess_windows.h b/core/fxcrt/cfx_fileaccess_windows.h index f05ab39d6e..6fd07d553c 100644 --- a/core/fxcrt/cfx_fileaccess_windows.h +++ b/core/fxcrt/cfx_fileaccess_windows.h @@ -9,7 +9,7 @@ #include "core/fxcrt/ifx_fileaccess.h" -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ class CFX_FileAccess_Windows : public IFX_FileAccess { public: CFX_FileAccess_Windows(); diff --git a/core/fxcrt/cfx_seekablestreamproxy.cpp b/core/fxcrt/cfx_seekablestreamproxy.cpp index 24f7869f45..3c0b5d5aef 100644 --- a/core/fxcrt/cfx_seekablestreamproxy.cpp +++ b/core/fxcrt/cfx_seekablestreamproxy.cpp @@ -6,7 +6,7 @@ #include "core/fxcrt/cfx_seekablestreamproxy.h" -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#if _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ #include <io.h> #endif diff --git a/core/fxcrt/fx_random.cpp b/core/fxcrt/fx_random.cpp index 483a56bbf4..56f84d59b3 100644 --- a/core/fxcrt/fx_random.cpp +++ b/core/fxcrt/fx_random.cpp @@ -16,12 +16,12 @@ #define MT_Upper_Mask 0x80000000 #define MT_Lower_Mask 0x7fffffff -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #include <wincrypt.h> -#else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#else // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #include <sys/time.h> #include <unistd.h> -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ namespace { @@ -33,7 +33,7 @@ struct MTContext { bool g_bHaveGlobalSeed = false; uint32_t g_nGlobalSeed = 0; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ bool GenerateSeedFromCryptoRandom(uint32_t* pSeed) { HCRYPTPROV hCP = 0; if (!::CryptAcquireContext(&hCP, nullptr, nullptr, PROV_RSA_FULL, 0) || @@ -50,30 +50,30 @@ uint32_t GenerateSeedFromEnvironment() { char c; uintptr_t p = reinterpret_cast<uintptr_t>(&c); uint32_t seed = ~static_cast<uint32_t>(p >> 3); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ SYSTEMTIME st; GetSystemTime(&st); seed ^= static_cast<uint32_t>(st.wSecond) * 1000000; seed ^= static_cast<uint32_t>(st.wMilliseconds) * 1000; seed ^= GetCurrentProcessId(); -#else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#else // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ struct timeval tv; gettimeofday(&tv, 0); seed ^= static_cast<uint32_t>(tv.tv_sec) * 1000000; seed ^= static_cast<uint32_t>(tv.tv_usec); seed ^= static_cast<uint32_t>(getpid()); -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ return seed; } void* ContextFromNextGlobalSeed() { if (!g_bHaveGlobalSeed) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ if (!GenerateSeedFromCryptoRandom(&g_nGlobalSeed)) g_nGlobalSeed = GenerateSeedFromEnvironment(); -#else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#else // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ g_nGlobalSeed = GenerateSeedFromEnvironment(); -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ g_bHaveGlobalSeed = true; } return FX_Random_MT_Start(++g_nGlobalSeed); diff --git a/core/fxcrt/fx_stream.cpp b/core/fxcrt/fx_stream.cpp index e15fdb0a81..bd75ad6ec7 100644 --- a/core/fxcrt/fx_stream.cpp +++ b/core/fxcrt/fx_stream.cpp @@ -100,7 +100,7 @@ bool IFX_SeekableStream::WriteString(const ByteStringView& str) { } FX_FileHandle* FX_OpenFolder(const char* path) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ auto pData = pdfium::MakeUnique<CFindFileDataA>(); pData->m_Handle = FindFirstFileExA((ByteString(path) + "/*.*").c_str(), FindExInfoStandard, @@ -121,7 +121,7 @@ bool FX_GetNextFile(FX_FileHandle* handle, if (!handle) return false; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ if (handle->m_bEnd) return false; @@ -145,7 +145,7 @@ void FX_CloseFolder(FX_FileHandle* handle) { if (!handle) return; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ FindClose(handle->m_Handle); delete handle; #else diff --git a/core/fxcrt/fx_stream.h b/core/fxcrt/fx_stream.h index d7944167c6..84e33c2060 100644 --- a/core/fxcrt/fx_stream.h +++ b/core/fxcrt/fx_stream.h @@ -11,13 +11,13 @@ #include "core/fxcrt/fx_system.h" #include "core/fxcrt/retain_ptr.h" -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #include <direct.h> class CFindFileDataA; typedef CFindFileDataA FX_FileHandle; -#else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#else // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #include <dirent.h> #include <fcntl.h> @@ -26,7 +26,7 @@ typedef CFindFileDataA FX_FileHandle; #include <unistd.h> typedef DIR FX_FileHandle; -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ FX_FileHandle* FX_OpenFolder(const char* path); bool FX_GetNextFile(FX_FileHandle* handle, ByteString* filename, bool* bFolder); @@ -109,7 +109,7 @@ class IFX_SeekableStream : public IFX_SeekableReadStream, bool Flush() override = 0; }; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ class CFindFileData { public: virtual ~CFindFileData() {} diff --git a/core/fxcrt/fx_system.cpp b/core/fxcrt/fx_system.cpp index bf13ad2e5e..a5ceec5be1 100644 --- a/core/fxcrt/fx_system.cpp +++ b/core/fxcrt/fx_system.cpp @@ -106,7 +106,7 @@ const char* FXSYS_i64toa(int64_t value, char* str, int radix) { return FXSYS_IntToStr<int64_t, uint64_t, char*>(value, str, radix); } -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ int FXSYS_GetACP() { return 0; @@ -219,7 +219,7 @@ int FXSYS_MultiByteToWideChar(uint32_t codepage, return wlen; } -#else // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#else // _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ size_t FXSYS_wcsftime(wchar_t* strDest, size_t maxsize, @@ -239,4 +239,4 @@ size_t FXSYS_wcsftime(wchar_t* strDest, return wcsftime(strDest, maxsize, format, timeptr); } -#endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ diff --git a/core/fxcrt/fx_system.h b/core/fxcrt/fx_system.h index 7a95bf4fd0..426dc085fc 100644 --- a/core/fxcrt/fx_system.h +++ b/core/fxcrt/fx_system.h @@ -18,34 +18,34 @@ #include <wchar.h> // _FX_OS_ values: -#define _FX_WIN32_DESKTOP_ 1 -#define _FX_WIN64_DESKTOP_ 2 -#define _FX_LINUX_DESKTOP_ 4 -#define _FX_MACOSX_ 7 -#define _FX_ANDROID_ 12 - -// _FXM_PLATFORM_ values; -#define _FXM_PLATFORM_WINDOWS_ 1 // _FX_WIN32_DESKTOP_ or _FX_WIN64_DESKTOP_. -#define _FXM_PLATFORM_LINUX_ 2 // _FX_LINUX_DESKTOP_ always. -#define _FXM_PLATFORM_APPLE_ 3 // _FX_MACOSX_ always. -#define _FXM_PLATFORM_ANDROID_ 4 // _FX_ANDROID_ always. +#define _FX_OS_WIN32_ 1 +#define _FX_OS_WIN64_ 2 +#define _FX_OS_LINUX_ 4 +#define _FX_OS_MACOSX_ 7 +#define _FX_OS_ANDROID_ 12 + +// _FX_PLATFORM_ values; +#define _FX_PLATFORM_WINDOWS_ 1 // _FX_OS_WIN32_ or _FX_OS_WIN64_. +#define _FX_PLATFORM_LINUX_ 2 // _FX_OS_LINUX_ always. +#define _FX_PLATFORM_APPLE_ 3 // _FX_OS_MACOSX_ always. +#define _FX_PLATFORM_ANDROID_ 4 // _FX_OS_ANDROID_ always. #ifndef _FX_OS_ #if defined(__ANDROID__) -#define _FX_OS_ _FX_ANDROID_ -#define _FXM_PLATFORM_ _FXM_PLATFORM_ANDROID_ +#define _FX_OS_ _FX_OS_ANDROID_ +#define _FX_PLATFORM_ _FX_PLATFORM_ANDROID_ #elif defined(_WIN32) -#define _FX_OS_ _FX_WIN32_DESKTOP_ -#define _FXM_PLATFORM_ _FXM_PLATFORM_WINDOWS_ +#define _FX_OS_ _FX_OS_WIN32_ +#define _FX_PLATFORM_ _FX_PLATFORM_WINDOWS_ #elif defined(_WIN64) -#define _FX_OS_ _FX_WIN64_DESKTOP_ -#define _FXM_PLATFORM_ _FXM_PLATFORM_WINDOWS_ +#define _FX_OS_ _FX_OS_WIN64_ +#define _FX_PLATFORM_ _FX_PLATFORM_WINDOWS_ #elif defined(__linux__) -#define _FX_OS_ _FX_LINUX_DESKTOP_ -#define _FXM_PLATFORM_ _FXM_PLATFORM_LINUX_ +#define _FX_OS_ _FX_OS_LINUX_ +#define _FX_PLATFORM_ _FX_PLATFORM_LINUX_ #elif defined(__APPLE__) -#define _FX_OS_ _FX_MACOSX_ -#define _FXM_PLATFORM_ _FXM_PLATFORM_APPLE_ +#define _FX_OS_ _FX_OS_MACOSX_ +#define _FX_PLATFORM_ _FX_PLATFORM_APPLE_ #endif #endif // _FX_OS_ @@ -57,15 +57,15 @@ #error Sorry, VC++ 2015 or later is required to compile PDFium. #endif // defined(_MSC_VER) && _MSC_VER < 1900 -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #include <windows.h> #include <sal.h> -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ #include <Carbon/Carbon.h> #include <libkern/OSAtomic.h> -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ #ifdef __cplusplus extern "C" { @@ -84,11 +84,11 @@ typedef size_t FX_STRSIZE; // files larger than 2GB even if the platform does. The value must be signed // to support -1 error returns. // TODO(tsepez): support larger files. -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #define FX_FILESIZE int32_t -#else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#else // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #define FX_FILESIZE off_t -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #ifndef ASSERT #ifndef NDEBUG @@ -154,7 +154,7 @@ extern "C" { #define FXSYS_wcslen(ptr) ((FX_STRSIZE)wcslen(ptr)) #endif // __cplusplus -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #define FXSYS_GetACP GetACP #define FXSYS_itoa _itoa #define FXSYS_strlwr _strlwr @@ -181,7 +181,7 @@ size_t FXSYS_wcsftime(wchar_t* strDest, #define FXSYS_wcsupr _wcsupr #endif // _NATIVE_WCHAR_T_DEFINED -#else // _FXM_PLATFORM == _FXM_PLATFORM_WINDOWS_ +#else // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ int FXSYS_GetACP(); char* FXSYS_itoa(int value, char* str, int radix); @@ -207,7 +207,7 @@ wchar_t* FXSYS_wcslwr(wchar_t* str); wchar_t* FXSYS_wcsupr(wchar_t* str); #define FXSYS_pow(a, b) (float)pow(a, b) #define FXSYS_wcsftime wcsftime -#endif // _FXM_PLATFORM == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #define FXDWORD_GET_LSBFIRST(p) \ ((static_cast<uint32_t>(p[3]) << 24) | (static_cast<uint32_t>(p[2]) << 16) | \ @@ -230,7 +230,7 @@ int FXSYS_round(float f); // size_t size; // printf("xyz: %" PRIuS, size); // The "u" in the macro corresponds to %u, and S is for "size". -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ #if (defined(_INTTYPES_H) || defined(_INTTYPES_H_)) && !defined(PRId64) #error "inttypes.h has already been included before this header file, but " @@ -247,20 +247,20 @@ int FXSYS_round(float f); #define PRIuS "zu" #endif -#else // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#else // _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ #if !defined(PRIuS) #define PRIuS "Iu" #endif -#endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ // Prevent a function from ever being inlined, typically because we'd // like it to appear in stack traces. -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #define NEVER_INLINE __declspec(noinline) -#else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#else // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #define NEVER_INLINE __attribute__((__noinline__)) -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #endif // CORE_FXCRT_FX_SYSTEM_H_ diff --git a/core/fxcrt/fx_system_unittest.cpp b/core/fxcrt/fx_system_unittest.cpp index 6a0fe71abe..73f9c75c1e 100644 --- a/core/fxcrt/fx_system_unittest.cpp +++ b/core/fxcrt/fx_system_unittest.cpp @@ -11,7 +11,7 @@ // Unit test covering cases where PDFium replaces well-known library // functionality on any given platformn. -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ namespace { @@ -158,7 +158,7 @@ TEST(fxcrt, FXSYS_i64toa) { "111111111111111111111111111111111111111111111111111111111111111"); } -#endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ TEST(fxcrt, FXSYS_wcsftime) { struct tm good_time = {}; diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp index 7f24378feb..b394facace 100644 --- a/core/fxge/agg/fx_agg_driver.cpp +++ b/core/fxge/agg/fx_agg_driver.cpp @@ -1109,7 +1109,7 @@ CFX_AggDeviceDriver::CFX_AggDeviceDriver( const RetainPtr<CFX_DIBitmap>& pOriDevice, bool bGroupKnockout) : m_pBitmap(pBitmap), -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ m_pPlatformGraphics(nullptr), #endif m_FillFlags(0), @@ -1127,7 +1127,7 @@ uint8_t* CFX_AggDeviceDriver::GetBuffer() const { return m_pBitmap->GetBuffer(); } -#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ != _FX_PLATFORM_APPLE_ void CFX_AggDeviceDriver::InitPlatform() {} void CFX_AggDeviceDriver::DestroyPlatform() {} @@ -1140,7 +1140,7 @@ bool CFX_AggDeviceDriver::DrawDeviceText(int nChars, uint32_t color) { return false; } -#endif // _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ +#endif // _FX_PLATFORM_ != _FX_PLATFORM_APPLE_ int CFX_AggDeviceDriver::GetDeviceCaps(int caps_id) const { switch (caps_id) { diff --git a/core/fxge/agg/fx_agg_driver.h b/core/fxge/agg/fx_agg_driver.h index 0afc7e3123..92500c3df6 100644 --- a/core/fxge/agg/fx_agg_driver.h +++ b/core/fxge/agg/fx_agg_driver.h @@ -112,7 +112,7 @@ class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver { RetainPtr<CFX_DIBitmap> m_pBitmap; std::unique_ptr<CFX_ClipRgn> m_pClipRgn; std::vector<std::unique_ptr<CFX_ClipRgn>> m_StateStack; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ void* m_pPlatformGraphics; #endif int m_FillFlags; diff --git a/core/fxge/cfx_facecache.cpp b/core/fxge/cfx_facecache.cpp index 217c41119c..782e5f9d07 100644 --- a/core/fxge/cfx_facecache.cpp +++ b/core/fxge/cfx_facecache.cpp @@ -24,7 +24,7 @@ #include "third_party/skia/include/core/SkStream.h" #include "third_party/skia/include/core/SkTypeface.h" -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #include "third_party/skia/include/ports/SkFontMgr.h" #include "third_party/skia/include/ports/SkFontMgr_empty.h" #endif @@ -284,7 +284,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(const CFX_Font* pFont, int nMatrixB = static_cast<int>(pMatrix->b * 10000); int nMatrixC = static_cast<int>(pMatrix->c * 10000); int nMatrixD = static_cast<int>(pMatrix->d * 10000); -#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ != _FX_PLATFORM_APPLE_ if (pFont->GetSubstFont()) { keygen.Generate(9, nMatrixA, nMatrixB, nMatrixC, nMatrixD, dest_width, anti_alias, pFont->GetSubstFont()->m_Weight, @@ -317,7 +317,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(const CFX_Font* pFont, } #endif ByteString FaceGlyphsKey(keygen.key_, keygen.key_len_); -#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ || defined _SKIA_SUPPORT_ || \ +#if _FX_PLATFORM_ != _FX_PLATFORM_APPLE_ || defined _SKIA_SUPPORT_ || \ defined _SKIA_SUPPORT_PATHS_ return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index, bFontStyle, dest_width, anti_alias); @@ -375,7 +375,7 @@ CFX_TypeFace* CFX_FaceCache::GetDeviceCache(const CFX_Font* pFont) { m_pTypeface = SkTypeface::MakeFromStream( new SkMemoryStream(pFont->GetFontData(), pFont->GetSize())); } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ if (!m_pTypeface) { sk_sp<SkFontMgr> customMgr(SkFontMgr_New_Custom_Empty()); m_pTypeface.reset(customMgr->createFromStream( @@ -386,7 +386,7 @@ CFX_TypeFace* CFX_FaceCache::GetDeviceCache(const CFX_Font* pFont) { } #endif -#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ != _FX_PLATFORM_APPLE_ void CFX_FaceCache::InitPlatform() {} #endif diff --git a/core/fxge/cfx_folderfontinfo.cpp b/core/fxge/cfx_folderfontinfo.cpp index 0dc61c998f..f2a19a4c4f 100644 --- a/core/fxge/cfx_folderfontinfo.cpp +++ b/core/fxge/cfx_folderfontinfo.cpp @@ -136,7 +136,7 @@ void CFX_FolderFontInfo::ScanPath(const ByteString& path) { } ByteString fullpath = path; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ fullpath += "\\"; #else fullpath += "/"; diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp index 6e252fc065..87ce9b53ec 100644 --- a/core/fxge/cfx_font.cpp +++ b/core/fxge/cfx_font.cpp @@ -217,7 +217,7 @@ CFX_Font::CFX_Font() m_pFontData(nullptr), m_pGsubData(nullptr), m_dwSize(0), -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ m_pPlatformFont(nullptr), #endif m_bEmbedded(false), @@ -244,7 +244,7 @@ bool CFX_Font::LoadClone(const CFX_Font* pFont) { m_dwSize = pFont->m_dwSize; m_pFontData = pFont->m_pFontData; m_pGsubData = pFont->m_pGsubData; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ m_pPlatformFont = pFont->m_pPlatformFont; #endif m_pOwnedStream = pFont->m_pOwnedStream; @@ -276,7 +276,7 @@ CFX_Font::~CFX_Font() { delete m_pOwnedStream; #endif // PDF_ENABLE_XFA FX_Free(m_pGsubData); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ && !defined _SKIA_SUPPORT_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ && !defined _SKIA_SUPPORT_ ReleasePlatformResource(); #endif } diff --git a/core/fxge/cfx_fontmapper.cpp b/core/fxge/cfx_fontmapper.cpp index 4e26c62eeb..ac840ea168 100644 --- a/core/fxge/cfx_fontmapper.cpp +++ b/core/fxge/cfx_fontmapper.cpp @@ -577,13 +577,13 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const ByteString& name, bItalic = italic_angle != 0; weight = old_weight; } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ +#if _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ const char* narrow_family = "LiberationSansNarrow"; -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_ANDROID_ const char* narrow_family = "RobotoCondensed"; #else const char* narrow_family = "ArialNarrow"; -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ auto pos = SubstName.Find("Narrow"); if (pos.has_value() && pos.value() != 0) family = narrow_family; @@ -644,8 +644,8 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const ByteString& name, } } else { if (Charset == FX_CHARSET_Symbol) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || \ - _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ || \ + _FX_PLATFORM_ == _FX_PLATFORM_ANDROID_ if (SubstName == "Symbol") { pSubstFont->m_Family = "Chrome Symbol"; pSubstFont->m_Charset = FX_CHARSET_Symbol; diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp index c6f9411176..9c44fbc1ef 100644 --- a/core/fxge/cfx_renderdevice.cpp +++ b/core/fxge/cfx_renderdevice.cpp @@ -332,7 +332,7 @@ void DrawNormalTextHelper(const RetainPtr<CFX_DIBitmap>& bitmap, } bool ShouldDrawDeviceText(const CFX_Font* pFont, uint32_t text_flags) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (text_flags & FXFONT_CIDFONT) return false; @@ -352,7 +352,7 @@ FXTEXT_CHARPOS::FXTEXT_CHARPOS() : m_Unicode(0), m_GlyphIndex(0), m_FontCharWidth(0), -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ m_ExtGID(0), #endif m_FallbackFontPosition(0), @@ -438,7 +438,7 @@ bool CFX_RenderDevice::CreateCompatibleBitmap( } if (m_RenderCaps & FXRC_BYTEMASK_OUTPUT) return pDIB->Create(width, height, FXDIB_8bppMask); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || defined _SKIA_SUPPORT_PATHS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ || defined _SKIA_SUPPORT_PATHS_ return pDIB->Create( width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Argb : FXDIB_Rgb32); diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h index 4dc8faa466..66fa0a8c6b 100644 --- a/core/fxge/cfx_renderdevice.h +++ b/core/fxge/cfx_renderdevice.h @@ -75,7 +75,7 @@ class FXTEXT_CHARPOS { uint32_t m_Unicode; uint32_t m_GlyphIndex; int32_t m_FontCharWidth; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ uint32_t m_ExtGID; #endif int32_t m_FallbackFontPosition; diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp index 8e105937ee..857ca9a3ce 100644 --- a/core/fxge/dib/cfx_dibitmap.cpp +++ b/core/fxge/dib/cfx_dibitmap.cpp @@ -296,7 +296,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, if (HasAlpha()) { if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) return false; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ } else if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb32)) { #else } else if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb)) { @@ -375,7 +375,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value) { if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) { return false; } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ } else if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb)) { #else } else if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb32)) { diff --git a/core/fxge/fx_font.h b/core/fxge/fx_font.h index e4b085a931..47a8b6084a 100644 --- a/core/fxge/fx_font.h +++ b/core/fxge/fx_font.h @@ -136,7 +136,7 @@ class CFX_Font { bool IsEmbedded() const { return m_bEmbedded; } uint8_t* GetSubData() const { return m_pGsubData; } void SetSubData(uint8_t* data) { m_pGsubData = data; } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ void* GetPlatformFont() const { return m_pPlatformFont; } void SetPlatformFont(void* font) { m_pPlatformFont = font; } #endif @@ -172,7 +172,7 @@ class CFX_Font { uint8_t* m_pFontData; uint8_t* m_pGsubData; uint32_t m_dwSize; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ void* m_pPlatformFont; #endif bool m_bEmbedded; diff --git a/core/fxge/fx_ge_fontmap.cpp b/core/fxge/fx_ge_fontmap.cpp index 0f2703875d..b11ee9c6f3 100644 --- a/core/fxge/fx_ge_fontmap.cpp +++ b/core/fxge/fx_ge_fontmap.cpp @@ -72,7 +72,7 @@ unsigned long _FTStreamRead(FXFT_Stream stream, void _FTStreamClose(FXFT_Stream stream); }; -#if _FX_OS_ == _FX_ANDROID_ +#if _FX_OS_ == _FX_OS_ANDROID_ std::unique_ptr<IFX_SystemFontInfo> IFX_SystemFontInfo::CreateDefault( const char** pUnused) { return nullptr; diff --git a/core/fxge/fx_ge_linux.cpp b/core/fxge/fx_ge_linux.cpp index 650510f63e..302470b386 100644 --- a/core/fxge/fx_ge_linux.cpp +++ b/core/fxge/fx_ge_linux.cpp @@ -13,7 +13,7 @@ #include "core/fxge/ifx_systemfontinfo.h" #include "third_party/base/ptr_util.h" -#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ +#if _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ namespace { const size_t kLinuxGpNameSize = 6; @@ -162,4 +162,4 @@ void CFX_GEModule::InitPlatform() { } void CFX_GEModule::DestroyPlatform() {} -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 6b82bc217b..c8af215f26 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -870,7 +870,7 @@ class SkiaState { m_positions[index + count] = {cp.m_Origin.x * flip, cp.m_Origin.y * vFlip}; m_glyphs[index + count] = static_cast<uint16_t>(cp.m_GlyphIndex); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (cp.m_ExtGID) m_glyphs[index + count] = static_cast<uint16_t>(cp.m_ExtGID); #endif @@ -1590,7 +1590,7 @@ bool CFX_SkiaDeviceDriver::DrawDeviceText(int nChars, } } glyphs[index] = static_cast<uint16_t>(cp.m_GlyphIndex); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (cp.m_ExtGID) glyphs[index] = static_cast<uint16_t>(cp.m_ExtGID); #endif diff --git a/fpdfsdk/cpdfsdk_datetime.h b/fpdfsdk/cpdfsdk_datetime.h index 08d43cc200..cbd3c36d44 100644 --- a/fpdfsdk/cpdfsdk_datetime.h +++ b/fpdfsdk/cpdfsdk_datetime.h @@ -7,7 +7,7 @@ #ifndef FPDFSDK_CPDFSDK_DATETIME_H_ #define FPDFSDK_CPDFSDK_DATETIME_H_ -#if _FX_OS_ == _FX_ANDROID_ +#if _FX_OS_ == _FX_OS_ANDROID_ #include <time.h> #else #include <ctime> diff --git a/fpdfsdk/fpdfannot_embeddertest.cpp b/fpdfsdk/fpdfannot_embeddertest.cpp index a2127b299c..34643dfb48 100644 --- a/fpdfsdk/fpdfannot_embeddertest.cpp +++ b/fpdfsdk/fpdfannot_embeddertest.cpp @@ -306,11 +306,11 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndSaveUnderlineAnnotation) { } TEST_F(FPDFAnnotEmbeddertest, ModifyRectQuadpointsWithAP) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const char md5_original[] = "63af8432fab95a67cdebb7cd0e514941"; const char md5_modified_highlight[] = "aec26075011349dec9bace891856b5f2"; const char md5_modified_square[] = "057f57a32be95975775e5ec513fdcb56"; -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ const char md5_original[] = "ade6762a70e85605546ce067e7d2148f"; const char md5_modified_highlight[] = "fb8440ed1a070b53ed5598ce7451cfad"; const char md5_modified_square[] = "7925f6726b343393f258e8b4e93dd65d"; @@ -481,12 +481,12 @@ TEST_F(FPDFAnnotEmbeddertest, RemoveAnnotation) { } TEST_F(FPDFAnnotEmbeddertest, AddAndModifyPath) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const char md5_original[] = "c35408717759562d1f8bf33d317483d2"; const char md5_modified_path[] = "cf3cea74bd46497520ff6c4d1ea228c8"; const char md5_two_paths[] = "e8994452fc4385337bae5522354e10ff"; const char md5_new_annot[] = "ee5372b31fede117fc83b9384598aa25"; -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ const char md5_original[] = "4f64add0190ede63f7bb9eb1e2e83edb"; const char md5_modified_path[] = "681f0d0738dded0722e146f6c219bfac"; const char md5_two_paths[] = "67c7e90fc3b64e20f6b69a1744f7f4f0"; @@ -660,11 +660,11 @@ TEST_F(FPDFAnnotEmbeddertest, ModifyAnnotationFlags) { } TEST_F(FPDFAnnotEmbeddertest, AddAndModifyImage) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const char md5_original[] = "c35408717759562d1f8bf33d317483d2"; const char md5_new_image[] = "ff012f5697436dfcaec25b32d1333596"; const char md5_modified_image[] = "86cf8cb2755a7a2046a543e66d9c1e61"; -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ const char md5_original[] = "4f64add0190ede63f7bb9eb1e2e83edb"; const char md5_new_image[] = "6fb176c20996cc554d0210d8c8b6138f"; const char md5_modified_image[] = "546959714dfb0dcd7e7b00259e8d178c"; @@ -739,11 +739,11 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndModifyImage) { } TEST_F(FPDFAnnotEmbeddertest, AddAndModifyText) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const char md5_original[] = "c35408717759562d1f8bf33d317483d2"; const char md5_new_text[] = "e5680ed048c2cfd9a1d27212cdf41286"; const char md5_modified_text[] = "79f5cfb0b07caaf936f65f6a7a57ce77"; -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ const char md5_original[] = "4f64add0190ede63f7bb9eb1e2e83edb"; const char md5_new_text[] = "998abae4962f8f41e094e7612d8339fc"; const char md5_modified_text[] = "e89b82ca4589b8f0b45fff42ca3a96a4"; @@ -871,9 +871,9 @@ TEST_F(FPDFAnnotEmbeddertest, GetSetStringValue) { FPDF_ClosePage(page); // Open the saved annotation. -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const char md5[] = "4d64e61c9c0f8c60ab3cc3234bb73b1c"; -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ const char md5[] = "0e3710ea6476f5bcba2cd39eb42d54e2"; #else const char md5[] = "831a3c465a56d2e0c89aef7bdf15306a"; diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp index 44d5aaf438..0fb736a9d4 100644 --- a/fpdfsdk/fpdfedit_embeddertest.cpp +++ b/fpdfsdk/fpdfedit_embeddertest.cpp @@ -412,7 +412,7 @@ TEST_F(FPDFEditEmbeddertest, PathOnTopOfText) { // Render and check the result. Text is slightly different on Mac. FPDF_BITMAP bitmap = RenderPage(page); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const char md5[] = "f9e6fa74230f234286bfcada9f7606d8"; #else const char md5[] = "bc6e6eb50dda4695ba0fb4d04ed82ada"; @@ -538,7 +538,7 @@ TEST_F(FPDFEditEmbeddertest, AddStandardFontText) { FPDFPageObj_Transform(text_object1, 1, 0, 0, 1, 20, 20); FPDFPage_InsertObject(page, text_object1); FPDF_BITMAP page_bitmap = RenderPage(page); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const char md5[] = "a4dddc1a3930fa694bbff9789dab4161"; #else const char md5[] = "7a35771853a1cbba38f6775807878625"; @@ -556,9 +556,9 @@ TEST_F(FPDFEditEmbeddertest, AddStandardFontText) { FPDFPageObj_Transform(text_object2, 1, 0, 0, 1, 100, 600); FPDFPage_InsertObject(page, text_object2); page_bitmap = RenderPage(page); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const char md5_2[] = "a5c4ace4c6f27644094813fe1441a21c"; -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ const char md5_2[] = "b231b329a4b566fb9b42bfc15fe59bb7"; #else const char md5_2[] = "f85fae151851436072b7b3c6703e506a"; @@ -576,9 +576,9 @@ TEST_F(FPDFEditEmbeddertest, AddStandardFontText) { FPDFPageObj_Transform(text_object3, 1, 1.5, 2, 0.5, 200, 200); FPDFPage_InsertObject(page, text_object3); page_bitmap = RenderPage(page); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const char md5_3[] = "40b3ef04f915ff4c4208948001763544"; -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ const char md5_3[] = "ba874b3b137f984510c4e287ed4ba7ae"; #else const char md5_3[] = "c5aed6a8ef05558c8c47d58c87cbcb46"; @@ -879,11 +879,11 @@ TEST_F(FPDFEditEmbeddertest, AddTrueTypeFontText) { FPDFPageObj_Transform(text_object, 1, 0, 0, 1, 400, 400); FPDFPage_InsertObject(page, text_object); FPDF_BITMAP page_bitmap = RenderPage(page); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const char md5[] = "17d2b6cd574cf66170b09c8927529a94"; #else const char md5[] = "1722c6a9deed953d730de9cd13dcbd55"; -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ CompareBitmap(page_bitmap, 612, 792, md5); FPDFBitmap_Destroy(page_bitmap); @@ -897,11 +897,11 @@ TEST_F(FPDFEditEmbeddertest, AddTrueTypeFontText) { FPDFPage_InsertObject(page, text_object2); } FPDF_BITMAP page_bitmap2 = RenderPage(page); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const char md5_2[] = "8eded4193ff1f0f77b8b600a825e97ea"; #else const char md5_2[] = "9d7885072058f6c3e68ecaf32e917f30"; -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ CompareBitmap(page_bitmap2, 612, 792, md5_2); FPDFBitmap_Destroy(page_bitmap2); @@ -930,7 +930,7 @@ TEST_F(FPDFEditEmbeddertest, TransformAnnot) { } // TODO(npm): Add tests using Japanese fonts in other OS. -#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ +#if _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ TEST_F(FPDFEditEmbeddertest, AddCIDFontText) { // Start with a blank page FPDF_PAGE page = FPDFPage_New(CreateNewDocument(), 0, 612, 792); @@ -984,7 +984,7 @@ TEST_F(FPDFEditEmbeddertest, AddCIDFontText) { FPDF_ClosePage(page); TestAndCloseSaved(612, 792, md5); } -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ TEST_F(FPDFEditEmbeddertest, SaveAndRender) { const char md5[] = "3c20472b0552c0c22b88ab1ed8c6202b"; diff --git a/fpdfsdk/fpdfeditpage.cpp b/fpdfsdk/fpdfeditpage.cpp index b4e71bf254..a1f2f396a5 100644 --- a/fpdfsdk/fpdfeditpage.cpp +++ b/fpdfsdk/fpdfeditpage.cpp @@ -34,7 +34,7 @@ #include "fpdfsdk/fpdfxfa/cpdfxfa_page.h" #endif // PDF_ENABLE_XFA -#if _FX_OS_ == _FX_ANDROID_ +#if _FX_OS_ == _FX_OS_ANDROID_ #include <time.h> #else #include <ctime> diff --git a/fpdfsdk/fpdfformfill_embeddertest.cpp b/fpdfsdk/fpdfformfill_embeddertest.cpp index 2597b37160..f5151cc456 100644 --- a/fpdfsdk/fpdfformfill_embeddertest.cpp +++ b/fpdfsdk/fpdfformfill_embeddertest.cpp @@ -519,7 +519,7 @@ TEST_F(FPDFFormFillEmbeddertest, BUG_765384) { #endif // PDF_ENABLE_V8 TEST_F(FPDFFormFillEmbeddertest, FormText) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const char md5_1[] = "5f11dbe575fe197a37c3fb422559f8ff"; const char md5_2[] = "35b1a4b679eafc749a0b6fda750c0e8d"; const char md5_3[] = "65c64a7c355388f719a752aa1e23f6fe"; diff --git a/fpdfsdk/fpdfsave.cpp b/fpdfsdk/fpdfsave.cpp index 9f1e684d72..13475f690e 100644 --- a/fpdfsdk/fpdfsave.cpp +++ b/fpdfsdk/fpdfsave.cpp @@ -34,7 +34,7 @@ #include "xfa/fxfa/cxfa_widgetacciterator.h" #endif -#if _FX_OS_ == _FX_ANDROID_ +#if _FX_OS_ == _FX_OS_ANDROID_ #include <time.h> #else #include <ctime> diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index 5312383000..cb5edcf251 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -52,7 +52,7 @@ #include "public/fpdf_formfill.h" #endif // PDF_ENABLE_XFA -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #include "core/fxge/cfx_windowsrenderdevice.h" // These checks are here because core/ and public/ cannot depend on each other. diff --git a/fpdfsdk/javascript/JS_Value.cpp b/fpdfsdk/javascript/JS_Value.cpp index 1a27d22270..ee81102583 100644 --- a/fpdfsdk/javascript/JS_Value.cpp +++ b/fpdfsdk/javascript/JS_Value.cpp @@ -31,12 +31,12 @@ double GetLocalTZA() { time_t t = 0; time(&t); localtime(&t); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ // In gcc 'timezone' is a global variable declared in time.h. In VC++, that // variable was removed in VC++ 2015, with _get_timezone replacing it. long timezone = 0; _get_timezone(&timezone); -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ return (double)(-(timezone * 1000)); } diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp index ba42c3ecbc..c065bd0946 100644 --- a/fpdfsdk/javascript/PublicMethods.cpp +++ b/fpdfsdk/javascript/PublicMethods.cpp @@ -90,7 +90,7 @@ void AlertIfPossible(CJS_EventContext* pContext, const wchar_t* swMsg) { pFormFillEnv->JS_appAlert(swMsg, nullptr, 0, 3); } -#if _FX_OS_ != _FX_ANDROID_ +#if _FX_OS_ != _FX_OS_ANDROID_ ByteString CalculateString(double dValue, int iDec, int* iDec2, @@ -752,7 +752,7 @@ bool CJS_PublicMethods::AFNumber_Format(CJS_Runtime* pRuntime, const std::vector<CJS_Value>& params, CJS_Value& vRet, WideString& sError) { -#if _FX_OS_ != _FX_ANDROID_ +#if _FX_OS_ != _FX_OS_ANDROID_ if (params.size() != 6) { sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR); return false; @@ -994,7 +994,7 @@ bool CJS_PublicMethods::AFPercent_Format(CJS_Runtime* pRuntime, const std::vector<CJS_Value>& params, CJS_Value& vRet, WideString& sError) { -#if _FX_OS_ != _FX_ANDROID_ +#if _FX_OS_ != _FX_OS_ANDROID_ if (params.size() != 2) { sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR); return false; diff --git a/fpdfsdk/javascript/util.cpp b/fpdfsdk/javascript/util.cpp index 04f1eb36cd..3fe7a86dc2 100644 --- a/fpdfsdk/javascript/util.cpp +++ b/fpdfsdk/javascript/util.cpp @@ -24,7 +24,7 @@ #include "fpdfsdk/javascript/cjs_runtime.h" #include "fpdfsdk/javascript/resource.h" -#if _FX_OS_ == _FX_ANDROID_ +#if _FX_OS_ == _FX_OS_ANDROID_ #include <ctype.h> #endif diff --git a/fpdfsdk/pwl/cpwl_font_map.cpp b/fpdfsdk/pwl/cpwl_font_map.cpp index 94d5fb8518..522b6ef67f 100644 --- a/fpdfsdk/pwl/cpwl_font_map.cpp +++ b/fpdfsdk/pwl/cpwl_font_map.cpp @@ -338,8 +338,7 @@ const FPDF_CharsetFontMap CPWL_FontMap::defaultTTFMap[] = { {FX_CHARSET_ShiftJIS, "MS Gothic"}, {FX_CHARSET_Hangul, "Batang"}, {FX_CHARSET_MSWin_Cyrillic, "Arial"}, -#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ || \ - _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ || _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ {FX_CHARSET_MSWin_EasternEuropean, "Arial"}, #else {FX_CHARSET_MSWin_EasternEuropean, "Tahoma"}, diff --git a/fxbarcode/oned/BC_OneDimWriter.cpp b/fxbarcode/oned/BC_OneDimWriter.cpp index e09e0ce5aa..5bcb3c38bc 100644 --- a/fxbarcode/oned/BC_OneDimWriter.cpp +++ b/fxbarcode/oned/BC_OneDimWriter.cpp @@ -158,7 +158,7 @@ void CBC_OneDimWriter::CalcTextInfo(const ByteString& text, charPos[0].m_Origin = CFX_PointF(penX + left, penY + top); charPos[0].m_GlyphIndex = encoding->GlyphFromCharCode(pCharCode[0]); charPos[0].m_FontCharWidth = cFont->GetGlyphWidth(charPos[0].m_GlyphIndex); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ charPos[0].m_ExtGID = charPos[0].m_GlyphIndex; #endif penX += (float)(charPos[0].m_FontCharWidth) * (float)fontSize / 1000.0f; @@ -166,7 +166,7 @@ void CBC_OneDimWriter::CalcTextInfo(const ByteString& text, charPos[i].m_Origin = CFX_PointF(penX + left, penY + top); charPos[i].m_GlyphIndex = encoding->GlyphFromCharCode(pCharCode[i]); charPos[i].m_FontCharWidth = cFont->GetGlyphWidth(charPos[i].m_GlyphIndex); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ charPos[i].m_ExtGID = charPos[i].m_GlyphIndex; #endif penX += (float)(charPos[i].m_FontCharWidth) * (float)fontSize / 1000.0f; diff --git a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp index e1a4917792..c8ee709235 100644 --- a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp +++ b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp @@ -443,7 +443,7 @@ void SplitString(const ByteString& content, uint8_t c = static_cast<uint8_t>(content[index]); if (((c >= 0xA1 && c <= 0xAA) || (c >= 0xB0 && c <= 0xFA))) break; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ bool high = !!IsDBCSLeadByte(content[index]); #else bool high = content[index] > 127; diff --git a/fxbarcode/utils.h b/fxbarcode/utils.h index ec3992805e..55d1c96af0 100644 --- a/fxbarcode/utils.h +++ b/fxbarcode/utils.h @@ -19,24 +19,24 @@ bool BC_FX_ByteString_Replace(ByteString& dst, void BC_FX_ByteString_Append(ByteString& dst, int32_t count, char c); void BC_FX_ByteString_Append(ByteString& dst, const std::vector<uint8_t>& ba); -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#if _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ #include <limits> -#elif _FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_LINUX_DESKTOP_ +#elif _FX_OS_ == _FX_OS_MACOSX_ || _FX_OS_ == _FX_OS_LINUX_ #include <limits.h> #endif -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#if _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ #define FXSYS_isnan(x) _isnan(x) -#elif _FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_LINUX_DESKTOP_ || \ - _FX_OS_ == _FX_ANDROID_ +#elif _FX_OS_ == _FX_OS_MACOSX_ || _FX_OS_ == _FX_OS_LINUX_ || \ + _FX_OS_ == _FX_OS_ANDROID_ #include <cmath> #define FXSYS_isnan(x) std::isnan(x) #endif -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#if _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ #define FXSYS_nan() (std::numeric_limits<float>::quiet_NaN()) -#elif _FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_LINUX_DESKTOP_ || \ - _FX_OS_ == _FX_ANDROID_ +#elif _FX_OS_ == _FX_OS_MACOSX_ || _FX_OS_ == _FX_OS_LINUX_ || \ + _FX_OS_ == _FX_OS_ANDROID_ #define FXSYS_nan() NAN #endif diff --git a/third_party/libtiff/0000-build-config.patch b/third_party/libtiff/0000-build-config.patch index 60f79b74b2..2989607412 100644 --- a/third_party/libtiff/0000-build-config.patch +++ b/third_party/libtiff/0000-build-config.patch @@ -100,7 +100,7 @@ diff a/third_party/libtiff/tiffconf.h b/third_party/libtiff/tiffconf.h +//fx_system.h already include the string.h in ANSIC + +/* Define to 1 if you have the <search.h> header file. */ -+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER >= 1900 ++#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ && _MSC_VER >= 1900 +// search.h is always available in VS 2015 and above, and may be +// available in earlier versions. +#define HAVE_SEARCH_H 1 diff --git a/third_party/libtiff/tiffconf.h b/third_party/libtiff/tiffconf.h index 4d2d7c9d9a..4b7cc2d93a 100644 --- a/third_party/libtiff/tiffconf.h +++ b/third_party/libtiff/tiffconf.h @@ -29,7 +29,7 @@ //fx_system.h already include the string.h in ANSIC /* Define to 1 if you have the <search.h> header file. */ -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER >= 1900 +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ && _MSC_VER >= 1900 // search.h is always available in VS 2015 and above, and may be // available in earlier versions. #define HAVE_SEARCH_H 1 diff --git a/xfa/fde/cfde_textout.cpp b/xfa/fde/cfde_textout.cpp index 0e9005d88e..c31b178ef6 100644 --- a/xfa/fde/cfde_textout.cpp +++ b/xfa/fde/cfde_textout.cpp @@ -52,7 +52,7 @@ bool CFDE_TextOut::DrawString(CFX_RenderDevice* device, } } -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ uint32_t dwFontStyle = pFont->GetFontStyles(); CFX_Font FxFont; auto SubstFxFont = pdfium::MakeUnique<CFX_SubstFont>(); @@ -61,7 +61,7 @@ bool CFDE_TextOut::DrawString(CFX_RenderDevice* device, SubstFxFont->m_WeightCJK = SubstFxFont->m_Weight; SubstFxFont->m_bItalicCJK = !!(dwFontStyle & FX_FONTSTYLE_Italic); FxFont.SetSubstFont(std::move(SubstFxFont)); -#endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ RetainPtr<CFGAS_GEFont> pCurFont; FXTEXT_CHARPOS* pCurCP = nullptr; @@ -76,12 +76,12 @@ bool CFDE_TextOut::DrawString(CFX_RenderDevice* device, pFxFont = pCurFont->GetDevFont(); CFX_Font* font; -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ FxFont.SetFace(pFxFont->GetFace()); font = &FxFont; #else font = pFxFont; -#endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ device->DrawNormalText(iCurCount, pCurCP, font, -fFontSize, pMatrix, color, FXTEXT_CLEARTYPE); @@ -99,20 +99,20 @@ bool CFDE_TextOut::DrawString(CFX_RenderDevice* device, if (pCurFont && iCurCount) { pFxFont = pCurFont->GetDevFont(); CFX_Font* font; -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ FxFont.SetFace(pFxFont->GetFace()); font = &FxFont; #else font = pFxFont; -#endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ bRet = device->DrawNormalText(iCurCount, pCurCP, font, -fFontSize, pMatrix, color, FXTEXT_CLEARTYPE); } -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ FxFont.SetFace(nullptr); -#endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ return bRet; } diff --git a/xfa/fgas/crt/cfgas_formatstring_unittest.cpp b/xfa/fgas/crt/cfgas_formatstring_unittest.cpp index b3d42f655e..51c001090c 100644 --- a/xfa/fgas/crt/cfgas_formatstring_unittest.cpp +++ b/xfa/fgas/crt/cfgas_formatstring_unittest.cpp @@ -32,7 +32,7 @@ class CFGAS_FormatStringTest : public testing::Test { } void SetTZ(const char* tz) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ _putenv_s("TZ", tz); _tzset(); #else diff --git a/xfa/fgas/font/cfgas_fontmgr.cpp b/xfa/fgas/font/cfgas_fontmgr.cpp index db6c4f1867..4eddfd2d6b 100644 --- a/xfa/fgas/font/cfgas_fontmgr.cpp +++ b/xfa/fgas/font/cfgas_fontmgr.cpp @@ -21,7 +21,7 @@ #include "xfa/fgas/font/cfgas_gefont.h" #include "xfa/fgas/font/fgas_fontutils.h" -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ namespace { @@ -437,17 +437,17 @@ FX_LPEnumAllFonts FX_GetDefFontEnumerator() { return FX_EnumGdiFonts; } -#else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#else // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ namespace { constexpr const char* g_FontFolders[] = { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ +#if _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ "/usr/share/fonts", "/usr/share/X11/fonts/Type1", "/usr/share/X11/fonts/TTF", "/usr/local/share/fonts", -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ "~/Library/Fonts", "/Library/Fonts", "/System/Library/Fonts", -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_ANDROID_ "/system/fonts", #endif }; @@ -1256,4 +1256,4 @@ int32_t CFGAS_FontMgr::IsPartName(const WideString& Name1, return 0; } -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ diff --git a/xfa/fgas/font/cfgas_fontmgr.h b/xfa/fgas/font/cfgas_fontmgr.h index 0b17b1d133..76b65f8719 100644 --- a/xfa/fgas/font/cfgas_fontmgr.h +++ b/xfa/fgas/font/cfgas_fontmgr.h @@ -36,7 +36,7 @@ class CFX_FontSourceEnum_File; class CFGAS_GEFont; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #define FX_FONTMATCHPARA_MatchStyle 0x01 struct FX_FONTMATCHPARAMS { @@ -81,7 +81,7 @@ typedef void (*FX_LPEnumAllFonts)(std::deque<FX_FONTDESCRIPTOR>* fonts, FX_LPEnumAllFonts FX_GetDefFontEnumerator(); -#else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#else // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ class CFX_FontDescriptor { public: CFX_FontDescriptor(); @@ -137,7 +137,7 @@ class CFX_FontSourceEnum_File { std::vector<ByteString> m_FolderPaths; }; -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ class CFGAS_FontMgr : public Observable<CFGAS_FontMgr> { public: @@ -158,7 +158,7 @@ class CFGAS_FontMgr : public Observable<CFGAS_FontMgr> { bool EnumFonts(); private: -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ RetainPtr<CFGAS_GEFont> LoadFont(const RetainPtr<CFGAS_GEFont>& pSrcFont, uint32_t dwFontStyles, uint16_t wCodePage); @@ -180,7 +180,7 @@ class CFGAS_FontMgr : public Observable<CFGAS_FontMgr> { std::map<uint32_t, RetainPtr<CFGAS_GEFont>> m_BufferFonts; std::map<uint32_t, RetainPtr<CFGAS_GEFont>> m_StreamFonts; std::map<uint32_t, RetainPtr<CFGAS_GEFont>> m_DeriveFonts; -#else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#else // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ bool EnumFontsFromFontMapper(); bool EnumFontsFromFiles(); void RegisterFace(FXFT_Face pFace, const WideString* pFaceName); @@ -223,7 +223,7 @@ class CFGAS_FontMgr : public Observable<CFGAS_FontMgr> { std::map<RetainPtr<CFGAS_GEFont>, RetainPtr<IFX_SeekableReadStream>> m_IFXFont2FileRead; std::set<wchar_t> m_FailedUnicodesSet; -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ }; #endif // XFA_FGAS_FONT_CFGAS_FONTMGR_H_ diff --git a/xfa/fgas/font/cfgas_gefont.cpp b/xfa/fgas/font/cfgas_gefont.cpp index ba79d77ca0..3e7a635b51 100644 --- a/xfa/fgas/font/cfgas_gefont.cpp +++ b/xfa/fgas/font/cfgas_gefont.cpp @@ -21,7 +21,7 @@ RetainPtr<CFGAS_GEFont> CFGAS_GEFont::LoadFont(const wchar_t* pszFontFamily, uint32_t dwFontStyles, uint16_t wCodePage, CFGAS_FontMgr* pFontMgr) { -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ if (!pFontMgr) return nullptr; @@ -55,7 +55,7 @@ RetainPtr<CFGAS_GEFont> CFGAS_GEFont::LoadFont( CFGAS_GEFont::CFGAS_GEFont(CFGAS_FontMgr* pFontMgr) : -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ m_bUseLogFontStyle(false), m_dwLogFontStyle(0), #endif @@ -67,7 +67,7 @@ CFGAS_GEFont::CFGAS_GEFont(CFGAS_FontMgr* pFontMgr) CFGAS_GEFont::CFGAS_GEFont(const RetainPtr<CFGAS_GEFont>& src, uint32_t dwFontStyles) : -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ m_bUseLogFontStyle(false), m_dwLogFontStyle(0), #endif @@ -95,7 +95,7 @@ CFGAS_GEFont::~CFGAS_GEFont() { delete m_pFont; } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ bool CFGAS_GEFont::LoadFontInternal(const wchar_t* pszFontFamily, uint32_t dwFontStyles, uint16_t wCodePage) { @@ -133,7 +133,7 @@ bool CFGAS_GEFont::LoadFontInternal(const wchar_t* pszFontFamily, return false; return InitFont(); } -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ bool CFGAS_GEFont::LoadFontInternal(CFX_Font* pExternalFont) { if (m_pFont || !pExternalFont) @@ -183,7 +183,7 @@ WideString CFGAS_GEFont::GetFamilyName() const { uint32_t CFGAS_GEFont::GetFontStyles() const { ASSERT(m_pFont); -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ if (m_bUseLogFontStyle) return m_dwLogFontStyle; #endif @@ -332,7 +332,7 @@ int32_t CFGAS_GEFont::GetGlyphIndex(wchar_t wUnicode, WideString wsFamily = GetFamilyName(); RetainPtr<CFGAS_GEFont> pFont = m_pFontMgr->GetFontByUnicode(wUnicode, GetFontStyles(), wsFamily.c_str()); -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ if (!pFont) pFont = m_pFontMgr->GetFontByUnicode(wUnicode, GetFontStyles(), nullptr); #endif diff --git a/xfa/fgas/font/cfgas_gefont.h b/xfa/fgas/font/cfgas_gefont.h index 9df9ea842d..9d990094fa 100644 --- a/xfa/fgas/font/cfgas_gefont.h +++ b/xfa/fgas/font/cfgas_gefont.h @@ -52,7 +52,7 @@ class CFGAS_GEFont : public Retainable { void SetFontProvider(CFGAS_PDFFontMgr* pProvider) { m_pProvider.Reset(pProvider); } -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ void SetLogicalFontStyle(uint32_t dwLogFontStyle) { m_bUseLogFontStyle = true; m_dwLogFontStyle = dwLogFontStyle; @@ -64,7 +64,7 @@ class CFGAS_GEFont : public Retainable { CFGAS_GEFont(const RetainPtr<CFGAS_GEFont>& src, uint32_t dwFontStyles); ~CFGAS_GEFont() override; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ bool LoadFontInternal(const wchar_t* pszFontFamily, uint32_t dwFontStyles, uint16_t wCodePage); @@ -89,7 +89,7 @@ class CFGAS_GEFont : public Retainable { bool bCharCode = false); WideString GetFamilyName() const; -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ bool m_bUseLogFontStyle; uint32_t m_dwLogFontStyle; #endif diff --git a/xfa/fgas/font/fgas_fontutils.cpp b/xfa/fgas/font/fgas_fontutils.cpp index bde8910682..2cf56ce7ca 100644 --- a/xfa/fgas/font/fgas_fontutils.cpp +++ b/xfa/fgas/font/fgas_fontutils.cpp @@ -188,7 +188,7 @@ const FGAS_FONTUSB g_FXGdiFontUSBTable[] = { {0xFFA0, 0xFFEF, 68, 0xFFFF}, }; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ const FGAS_FontInfo g_XFAFontsMap[] = { {0x01d5d33e, L"SimSun", L"Arial", 0, 936}, {0x01e4f102, L"YouYuan", L"Arial", 1, 936}, @@ -436,7 +436,7 @@ const FGAS_FontInfo g_XFAFontsMap[] = { {0xfe209a82, L"LucidaCalligraphy", L"Arial", 0, 1252}, {0xfef135f8, L"AdobeHeitiStd-Regular", L"Batang,Century,Dotum", 0, 936}, }; -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ const FGAS_FontInfo g_XFAFontsMap[] = { {0x01d5d33e, L"SimSun", L"WenQuanYi Zen Hei Mono,AR PL UMing CN,AR PL UMing HK,AR PL UMing TW,AR " @@ -1025,7 +1025,7 @@ const FGAS_FontInfo g_XFAFontsMap[] = { L"Sharp,WenQuanYi Micro Hei", 0, 936}, }; -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const FGAS_FontInfo g_XFAFontsMap[] = { {0x01d5d33e, L"SimSun", L"STHeiti,Heiti TC,STFangsong", 0, 936}, {0x01e4f102, L"YouYuan", L"STHeiti,Heiti TC,STFangsong", 1, 936}, @@ -1426,7 +1426,7 @@ const FGAS_FontInfo g_XFAFontsMap[] = { L"Kokonor,Damascus,STIXNonUnicode,STHeiti,Arial Black", 0, 1252}, {0xfef135f8, L"AdobeHeitiStd-Regular", L"Heiti TC,STHeiti", 0, 936}, }; -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_ANDROID_ const FGAS_FontInfo g_XFAFontsMap[] = { {0x01d5d33e, L"SimSun", L"Droid Sans Fallback", 0, 936}, {0x01e4f102, L"YouYuan", L"Droid Sans Fallback", 1, 936}, diff --git a/xfa/fgas/layout/cfx_rtfbreak.cpp b/xfa/fgas/layout/cfx_rtfbreak.cpp index 8768aa34ff..cf37030db0 100644 --- a/xfa/fgas/layout/cfx_rtfbreak.cpp +++ b/xfa/fgas/layout/cfx_rtfbreak.cpp @@ -730,7 +730,7 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText, if (pCharPos->m_GlyphIndex == 0xFFFF) pCharPos->m_GlyphIndex = pFont->GetGlyphIndex(wch, false); } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ pCharPos->m_ExtGID = pCharPos->m_GlyphIndex; #endif pCharPos->m_FontCharWidth = iCharWidth; diff --git a/xfa/fgas/layout/cfx_txtbreak.cpp b/xfa/fgas/layout/cfx_txtbreak.cpp index 403b7e6c11..a7683bc978 100644 --- a/xfa/fgas/layout/cfx_txtbreak.cpp +++ b/xfa/fgas/layout/cfx_txtbreak.cpp @@ -828,7 +828,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun, } if (!bEmptyChar || (bEmptyChar && !bSkipSpace)) { pCharPos->m_GlyphIndex = pFont->GetGlyphIndex(wForm, false); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ pCharPos->m_ExtGID = pCharPos->m_GlyphIndex; #endif pCharPos->m_FontCharWidth = iCharWidth; diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp index fa5ee63b77..45e69ab843 100644 --- a/xfa/fwl/cfwl_edit.cpp +++ b/xfa/fwl/cfwl_edit.cpp @@ -37,7 +37,7 @@ namespace { const int kEditMargin = 3; -#if (_FX_OS_ == _FX_MACOSX_) +#if (_FX_OS_ == _FX_OS_MACOSX_) constexpr int kEditingModifier = FWL_KEYFLAG_Command; #else constexpr int kEditingModifier = FWL_KEYFLAG_Ctrl; diff --git a/xfa/fwl/cfwl_form.cpp b/xfa/fwl/cfwl_form.cpp index 4761693d3e..9042e3bc74 100644 --- a/xfa/fwl/cfwl_form.cpp +++ b/xfa/fwl/cfwl_form.cpp @@ -114,7 +114,7 @@ CFWL_Widget* CFWL_Form::DoModal() { RemoveStates(FWL_WGTSTATE_Invisible); pDriver->Run(); -#if _FX_OS_ != _FX_MACOSX_ +#if _FX_OS_ != _FX_OS_MACOSX_ pDriver->PopNoteLoop(); #endif @@ -126,7 +126,7 @@ void CFWL_Form::EndDoModal() { if (!m_pNoteLoop) return; -#if (_FX_OS_ == _FX_MACOSX_) +#if (_FX_OS_ == _FX_OS_MACOSX_) m_pNoteLoop->EndModalLoop(); const CFWL_App* pApp = GetOwnerApp(); if (!pApp) diff --git a/xfa/fwl/cfwl_form.h b/xfa/fwl/cfwl_form.h index 014ed22798..f62d3755bf 100644 --- a/xfa/fwl/cfwl_form.h +++ b/xfa/fwl/cfwl_form.h @@ -16,7 +16,7 @@ #define FWL_CLASS_Form L"FWL_FORM" #define FWL_CLASS_FormProxy L"FWL_FORMPROXY" -#if (_FX_OS_ == _FX_MACOSX_) +#if (_FX_OS_ == _FX_OS_MACOSX_) #define FWL_UseMacSystemBorder #endif diff --git a/xfa/fwl/cfwl_notedriver.cpp b/xfa/fwl/cfwl_notedriver.cpp index c0dba02764..e6b869da58 100644 --- a/xfa/fwl/cfwl_notedriver.cpp +++ b/xfa/fwl/cfwl_notedriver.cpp @@ -106,8 +106,8 @@ bool CFWL_NoteDriver::SetFocus(CFWL_Widget* pFocus) { } void CFWL_NoteDriver::Run() { -#if _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_WIN32_DESKTOP_ || \ - _FX_OS_ == _FX_WIN64_DESKTOP_ +#if _FX_OS_ == _FX_OS_LINUX_ || _FX_OS_ == _FX_OS_WIN32_ || \ + _FX_OS_ == _FX_OS_WIN64_ for (;;) { CFWL_NoteLoop* pTopLoop = GetTopLoop(); if (!pTopLoop || !pTopLoop->ContinueModal()) @@ -288,7 +288,7 @@ bool CFWL_NoteDriver::DoKillFocus(CFWL_Message* pMessage, bool CFWL_NoteDriver::DoKey(CFWL_Message* pMessage, CFWL_Widget* pMessageForm) { CFWL_MessageKey* pMsg = static_cast<CFWL_MessageKey*>(pMessage); -#if (_FX_OS_ != _FX_MACOSX_) +#if (_FX_OS_ != _FX_OS_MACOSX_) if (pMsg->m_dwCmd == FWL_KeyCommand::KeyDown && pMsg->m_dwKeyCode == FWL_VKEY_Tab) { CFWL_WidgetMgr* pWidgetMgr = pMessageForm->GetOwnerApp()->GetWidgetMgr(); diff --git a/xfa/fwl/cfwl_widgetmgr.cpp b/xfa/fwl/cfwl_widgetmgr.cpp index 1432c10891..e98233bebf 100644 --- a/xfa/fwl/cfwl_widgetmgr.cpp +++ b/xfa/fwl/cfwl_widgetmgr.cpp @@ -33,7 +33,7 @@ CFWL_WidgetMgr::CFWL_WidgetMgr(CXFA_FFApp* pAdapterNative) m_pAdapter(pAdapterNative->GetFWLAdapterWidgetMgr()) { ASSERT(m_pAdapter); m_mapWidgetItem[nullptr] = pdfium::MakeUnique<Item>(); -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#if _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ m_rtScreen.Reset(); #endif } @@ -407,7 +407,7 @@ void CFWL_WidgetMgr::OnProcessMessageToForm(CFWL_Message* pMessage) { else pNoteDriver->QueueMessage(pMessage->Clone()); -#if (_FX_OS_ == _FX_MACOSX_) +#if (_FX_OS_ == _FX_OS_MACOSX_) CFWL_NoteLoop* pTopLoop = pNoteDriver->GetTopLoop(); if (pTopLoop) pNoteDriver->UnqueueMessageAndProcess(pTopLoop); @@ -423,15 +423,15 @@ void CFWL_WidgetMgr::OnDrawWidget(CFWL_Widget* pWidget, CFX_RectF clipCopy(0, 0, pWidget->GetWidgetRect().Size()); CFX_RectF clipBounds; -#if _FX_OS_ == _FX_MACOSX_ +#if _FX_OS_ == _FX_OS_MACOSX_ if (IsFormDisabled()) { -#endif // _FX_OS_ == _FX_MACOSX_ +#endif // _FX_OS_ == _FX_OS_MACOSX_ pWidget->GetDelegate()->OnDrawWidget(pGraphics, matrix); clipBounds = pGraphics->GetClipRect(); clipCopy = clipBounds; -#if _FX_OS_ == _FX_MACOSX_ +#if _FX_OS_ == _FX_OS_MACOSX_ } else { clipBounds = CFX_RectF(matrix.a, matrix.b, matrix.c, matrix.d); // FIXME: const cast @@ -439,7 +439,7 @@ void CFWL_WidgetMgr::OnDrawWidget(CFWL_Widget* pWidget, pMatrixHack->SetIdentity(); pWidget->GetDelegate()->OnDrawWidget(pGraphics, *pMatrixHack); } -#endif // _FX_OS_ == _FX_MACOSX_ +#endif // _FX_OS_ == _FX_OS_MACOSX_ if (!IsFormDisabled()) clipBounds.Intersect(pWidget->GetClientRect()); @@ -606,7 +606,7 @@ CFWL_WidgetMgr::Item::Item(CFWL_Widget* widget) pNext(nullptr), pWidget(widget), iRedrawCounter(0) -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#if _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ , bOutsideChanged(false) #endif diff --git a/xfa/fwl/cfwl_widgetmgr.h b/xfa/fwl/cfwl_widgetmgr.h index 8707d3d4db..550f1d40bf 100644 --- a/xfa/fwl/cfwl_widgetmgr.h +++ b/xfa/fwl/cfwl_widgetmgr.h @@ -81,7 +81,7 @@ class CFWL_WidgetMgr { CFWL_Widget* const pWidget; std::unique_ptr<CXFA_Graphics> pOffscreen; int32_t iRedrawCounter; -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#if _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ bool bOutsideChanged; #endif }; @@ -114,7 +114,7 @@ class CFWL_WidgetMgr { uint32_t m_dwCapability; std::map<CFWL_Widget*, std::unique_ptr<Item>> m_mapWidgetItem; UnownedPtr<CXFA_FWLAdapterWidgetMgr> const m_pAdapter; -#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ +#if _FX_OS_ == _FX_OS_WIN32_ || _FX_OS_ == _FX_OS_WIN64_ CFX_RectF m_rtScreen; #endif }; diff --git a/xfa/fwl/theme/cfwl_listboxtp.cpp b/xfa/fwl/theme/cfwl_listboxtp.cpp index deb7d6ff50..432be21193 100644 --- a/xfa/fwl/theme/cfwl_listboxtp.cpp +++ b/xfa/fwl/theme/cfwl_listboxtp.cpp @@ -69,7 +69,7 @@ void CFWL_ListBoxTP::DrawListBoxItem(CXFA_Graphics* pGraphics, pGraphics->SetFillColor(CXFA_Color(FWLTHEME_COLOR_BKSelected)); CFX_RectF rt(*prtItem); CXFA_Path path; -#if (_FX_OS_ == _FX_MACOSX_) +#if (_FX_OS_ == _FX_OS_MACOSX_) path.AddRectangle(rt.left, rt.top, rt.width - 1, rt.height - 1); #else path.AddRectangle(rt.left, rt.top, rt.width, rt.height); diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h index 32a48d136d..a7a217f4a0 100644 --- a/xfa/fwl/theme/cfwl_widgettp.h +++ b/xfa/fwl/theme/cfwl_widgettp.h @@ -25,7 +25,7 @@ class CFWL_ThemeText; class CFGAS_FontMgr; class CFWL_Widget; -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ class CFX_FontSourceEnum_File; #endif diff --git a/xfa/fxfa/parser/cxfa_timezoneprovider.cpp b/xfa/fxfa/parser/cxfa_timezoneprovider.cpp index 022b9225b4..ff5ecce4c7 100644 --- a/xfa/fxfa/parser/cxfa_timezoneprovider.cpp +++ b/xfa/fxfa/parser/cxfa_timezoneprovider.cpp @@ -11,7 +11,7 @@ static bool g_bProviderTimeZoneSet = false; CXFA_TimeZoneProvider::CXFA_TimeZoneProvider() { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ if (!g_bProviderTimeZoneSet) { g_bProviderTimeZoneSet = true; _tzset(); |