diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-03-13 16:43:37 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-14 14:14:51 +0000 |
commit | 812e96c2b4c5908a1979da5e27cdcecda0d1dfc9 (patch) | |
tree | f0b0607f6b757eb22237527215094bd87b5d03ba /core/fxge | |
parent | 893822aa5b6254591f8e80fbffcbb4fa6ad849aa (diff) | |
download | pdfium-812e96c2b4c5908a1979da5e27cdcecda0d1dfc9.tar.xz |
Replace FX_CHAR and FX_WCHAR with underlying types.
Change-Id: I96e0a20d66b9184d22f64d8e4ce0dadd5a78c1e8
Reviewed-on: https://pdfium-review.googlesource.com/2967
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxge')
26 files changed, 91 insertions, 92 deletions
diff --git a/core/fxge/android/cfpf_skiafont.cpp b/core/fxge/android/cfpf_skiafont.cpp index 5e11efae9d..e00aa840e4 100644 --- a/core/fxge/android/cfpf_skiafont.cpp +++ b/core/fxge/android/cfpf_skiafont.cpp @@ -53,7 +53,7 @@ CFX_ByteString CFPF_SkiaFont::GetPsName() { return FXFT_Get_Postscript_Name(m_Face); } -int32_t CFPF_SkiaFont::GetGlyphIndex(FX_WCHAR wUnicode) { +int32_t CFPF_SkiaFont::GetGlyphIndex(wchar_t wUnicode) { if (!m_Face) return wUnicode; if (FXFT_Select_Charmap(m_Face, FXFT_ENCODING_UNICODE)) diff --git a/core/fxge/android/cfpf_skiafont.h b/core/fxge/android/cfpf_skiafont.h index b72c111177..657ced88f2 100644 --- a/core/fxge/android/cfpf_skiafont.h +++ b/core/fxge/android/cfpf_skiafont.h @@ -25,7 +25,7 @@ class CFPF_SkiaFont { CFX_ByteString GetPsName(); uint32_t GetFontStyle() const { return m_dwStyle; } uint8_t GetCharset() const { return m_uCharset; } - int32_t GetGlyphIndex(FX_WCHAR wUnicode); + int32_t GetGlyphIndex(wchar_t wUnicode); int32_t GetGlyphWidth(int32_t iGlyphIndex); int32_t GetAscent() const; int32_t GetDescent() const; diff --git a/core/fxge/android/cfpf_skiafontdescriptor.h b/core/fxge/android/cfpf_skiafontdescriptor.h index 57b85404ad..56f8a34fa5 100644 --- a/core/fxge/android/cfpf_skiafontdescriptor.h +++ b/core/fxge/android/cfpf_skiafontdescriptor.h @@ -23,14 +23,14 @@ class CFPF_SkiaFontDescriptor { virtual int32_t GetType() const { return FPF_SKIAFONTTYPE_Unknown; } - void SetFamily(const FX_CHAR* pFamily) { + void SetFamily(const char* pFamily) { FX_Free(m_pFamily); int32_t iSize = FXSYS_strlen(pFamily); - m_pFamily = FX_Alloc(FX_CHAR, iSize + 1); - FXSYS_memcpy(m_pFamily, pFamily, iSize * sizeof(FX_CHAR)); + m_pFamily = FX_Alloc(char, iSize + 1); + FXSYS_memcpy(m_pFamily, pFamily, iSize * sizeof(char)); m_pFamily[iSize] = 0; } - FX_CHAR* m_pFamily; + char* m_pFamily; uint32_t m_dwStyle; int32_t m_iFaceIndex; uint32_t m_dwCharsets; diff --git a/core/fxge/android/cfpf_skiafontmgr.cpp b/core/fxge/android/cfpf_skiafontmgr.cpp index e3511be67a..00d989e55c 100644 --- a/core/fxge/android/cfpf_skiafontmgr.cpp +++ b/core/fxge/android/cfpf_skiafontmgr.cpp @@ -87,12 +87,12 @@ uint32_t FPF_SkiaGetSubstFont(uint32_t dwHash, return 0; } -uint32_t FPF_GetHashCode_StringA(const FX_CHAR* pStr, int32_t iLength) { +uint32_t FPF_GetHashCode_StringA(const char* pStr, int32_t iLength) { if (!pStr) return 0; if (iLength < 0) iLength = FXSYS_strlen(pStr); - const FX_CHAR* pStrEnd = pStr + iLength; + const char* pStrEnd = pStr + iLength; uint32_t uHashCode = 0; while (pStr < pStrEnd) uHashCode = 31 * uHashCode + FXSYS_tolower(*pStr++); @@ -160,9 +160,9 @@ uint32_t FPF_SkiaGetCharset(uint8_t uCharset) { uint32_t FPF_SKIANormalizeFontName(const CFX_ByteStringC& bsfamily) { uint32_t dwHash = 0; int32_t iLength = bsfamily.GetLength(); - const FX_CHAR* pBuffer = bsfamily.c_str(); + const char* pBuffer = bsfamily.c_str(); for (int32_t i = 0; i < iLength; i++) { - FX_CHAR ch = pBuffer[i]; + char ch = pBuffer[i]; if (ch == ' ' || ch == '-' || ch == ',') continue; dwHash = 31 * dwHash + FXSYS_tolower(ch); diff --git a/core/fxge/android/cfpf_skiapathfont.h b/core/fxge/android/cfpf_skiapathfont.h index f1cff2574b..f8ddc6c83a 100644 --- a/core/fxge/android/cfpf_skiapathfont.h +++ b/core/fxge/android/cfpf_skiapathfont.h @@ -20,14 +20,14 @@ class CFPF_SkiaPathFont : public CFPF_SkiaFontDescriptor { // CFPF_SkiaFontDescriptor int32_t GetType() const override { return FPF_SKIAFONTTYPE_Path; } - void SetPath(const FX_CHAR* pPath) { + void SetPath(const char* pPath) { FX_Free(m_pPath); int32_t iSize = FXSYS_strlen(pPath); - m_pPath = FX_Alloc(FX_CHAR, iSize + 1); - FXSYS_memcpy(m_pPath, pPath, iSize * sizeof(FX_CHAR)); + m_pPath = FX_Alloc(char, iSize + 1); + FXSYS_memcpy(m_pPath, pPath, iSize * sizeof(char)); m_pPath[iSize] = 0; } - FX_CHAR* m_pPath; + char* m_pPath; }; #endif // CORE_FXGE_ANDROID_CFPF_SKIAPATHFONT_H_ diff --git a/core/fxge/android/cfx_androidfontinfo.cpp b/core/fxge/android/cfx_androidfontinfo.cpp index 03a7ffbd9e..6ab9c6479a 100644 --- a/core/fxge/android/cfx_androidfontinfo.cpp +++ b/core/fxge/android/cfx_androidfontinfo.cpp @@ -30,7 +30,7 @@ void* CFX_AndroidFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, - const FX_CHAR* face, + const char* face, int& iExact) { if (!m_pFontMgr) return nullptr; @@ -50,7 +50,7 @@ void* CFX_AndroidFontInfo::MapFont(int weight, FPF_MATCHFONT_REPLACEANSI); } -void* CFX_AndroidFontInfo::GetFont(const FX_CHAR* face) { +void* CFX_AndroidFontInfo::GetFont(const char* face) { return nullptr; } diff --git a/core/fxge/android/cfx_androidfontinfo.h b/core/fxge/android/cfx_androidfontinfo.h index 94e1db88ac..076b956a0c 100644 --- a/core/fxge/android/cfx_androidfontinfo.h +++ b/core/fxge/android/cfx_androidfontinfo.h @@ -27,9 +27,9 @@ class CFX_AndroidFontInfo : public IFX_SystemFontInfo { bool bItalic, int charset, int pitch_family, - const FX_CHAR* face, + const char* face, int& bExact) override; - void* GetFont(const FX_CHAR* face) override; + void* GetFont(const char* face) override; uint32_t GetFontData(void* hFont, uint32_t table, uint8_t* buffer, diff --git a/core/fxge/apple/fx_mac_imp.cpp b/core/fxge/apple/fx_mac_imp.cpp index c05aea34f5..2df6e754a0 100644 --- a/core/fxge/apple/fx_mac_imp.cpp +++ b/core/fxge/apple/fx_mac_imp.cpp @@ -14,8 +14,8 @@ namespace { const struct { - const FX_CHAR* m_pName; - const FX_CHAR* m_pSubstName; + const char* m_pName; + const char* m_pSubstName; } g_Base14Substs[] = { {"Courier", "Courier New"}, {"Courier-Bold", "Courier New Bold"}, @@ -41,7 +41,7 @@ class CFX_MacFontInfo : public CFX_FolderFontInfo { bool bItalic, int charset, int pitch_family, - const FX_CHAR* family, + const char* family, int& iExact) override; }; @@ -61,7 +61,7 @@ void* CFX_MacFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, - const FX_CHAR* cstr_face, + const char* cstr_face, int& iExact) { CFX_ByteString face = cstr_face; for (size_t i = 0; i < FX_ArraySize(g_Base14Substs); ++i) { diff --git a/core/fxge/cfx_fontmgr.h b/core/fxge/cfx_fontmgr.h index 432f34b38c..b7f2e1a032 100644 --- a/core/fxge/cfx_fontmgr.h +++ b/core/fxge/cfx_fontmgr.h @@ -43,7 +43,7 @@ class CFX_FontMgr { uint8_t* pData, uint32_t size, int font_offset); - FXFT_Face GetFileFace(const FX_CHAR* filename, int face_index); + FXFT_Face GetFileFace(const char* filename, int face_index); FXFT_Face GetFixedFace(const uint8_t* pData, uint32_t size, int face_index); void ReleaseFace(FXFT_Face face); void SetSystemFontInfo(std::unique_ptr<IFX_SystemFontInfo> pFontInfo); diff --git a/core/fxge/cfx_unicodeencodingex.h b/core/fxge/cfx_unicodeencodingex.h index df2edbe1bf..21deb44d79 100644 --- a/core/fxge/cfx_unicodeencodingex.h +++ b/core/fxge/cfx_unicodeencodingex.h @@ -24,7 +24,7 @@ class CFX_UnicodeEncodingEx : public CFX_UnicodeEncoding { // CFX_UnicodeEncoding: uint32_t GlyphFromCharCode(uint32_t charcode) override; - uint32_t CharCodeFromUnicode(FX_WCHAR Unicode) const; + uint32_t CharCodeFromUnicode(wchar_t Unicode) const; private: uint32_t m_nEncodingID; diff --git a/core/fxge/ge/cfx_folderfontinfo.cpp b/core/fxge/ge/cfx_folderfontinfo.cpp index 776a37319b..52dfc2d243 100644 --- a/core/fxge/ge/cfx_folderfontinfo.cpp +++ b/core/fxge/ge/cfx_folderfontinfo.cpp @@ -16,8 +16,8 @@ namespace { const struct { - const FX_CHAR* m_pName; - const FX_CHAR* m_pSubstName; + const char* m_pName; + const char* m_pSubstName; } Base14Substs[] = { {"Courier", "Courier New"}, {"Courier-Bold", "Courier New Bold"}, @@ -275,7 +275,7 @@ void* CFX_FolderFontInfo::FindFont(int weight, bool bItalic, int charset, int pitch_family, - const FX_CHAR* family, + const char* family, bool bMatchName) { CFX_FontFaceInfo* pFind = nullptr; if (charset == FXFONT_ANSI_CHARSET && (pitch_family & FXFONT_FF_FIXEDPITCH)) @@ -306,7 +306,7 @@ void* CFX_FolderFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, - const FX_CHAR* family, + const char* family, int& iExact) { return nullptr; } @@ -320,7 +320,7 @@ void* CFX_FolderFontInfo::MapFontByUnicode(uint32_t dwUnicode, } #endif // PDF_ENABLE_XFA -void* CFX_FolderFontInfo::GetFont(const FX_CHAR* face) { +void* CFX_FolderFontInfo::GetFont(const char* face) { auto it = m_FontList.find(face); return it != m_FontList.end() ? it->second : nullptr; } diff --git a/core/fxge/ge/cfx_folderfontinfo.h b/core/fxge/ge/cfx_folderfontinfo.h index d031eef3d0..9e9a1a2a6a 100644 --- a/core/fxge/ge/cfx_folderfontinfo.h +++ b/core/fxge/ge/cfx_folderfontinfo.h @@ -27,7 +27,7 @@ class CFX_FolderFontInfo : public IFX_SystemFontInfo { bool bItalic, int charset, int pitch_family, - const FX_CHAR* face, + const char* face, int& bExact) override; #ifdef PDF_ENABLE_XFA void* MapFontByUnicode(uint32_t dwUnicode, @@ -35,7 +35,7 @@ class CFX_FolderFontInfo : public IFX_SystemFontInfo { bool bItalic, int pitch_family) override; #endif // PDF_ENABLE_XFA - void* GetFont(const FX_CHAR* face) override; + void* GetFont(const char* face) override; uint32_t GetFontData(void* hFont, uint32_t table, uint8_t* buffer, @@ -56,7 +56,7 @@ class CFX_FolderFontInfo : public IFX_SystemFontInfo { bool bItalic, int charset, int pitch_family, - const FX_CHAR* family, + const char* family, bool bMatchName); std::map<CFX_ByteString, CFX_FontFaceInfo*> m_FontList; diff --git a/core/fxge/ge/cfx_fontmapper.cpp b/core/fxge/ge/cfx_fontmapper.cpp index 064fc9610a..622b457396 100644 --- a/core/fxge/ge/cfx_fontmapper.cpp +++ b/core/fxge/ge/cfx_fontmapper.cpp @@ -25,7 +25,7 @@ namespace { const int kNumStandardFonts = 14; -const FX_CHAR* const g_Base14FontNames[kNumStandardFonts] = { +const char* const g_Base14FontNames[kNumStandardFonts] = { "Courier", "Courier-Bold", "Courier-BoldOblique", @@ -43,7 +43,7 @@ const FX_CHAR* const g_Base14FontNames[kNumStandardFonts] = { }; const struct AltFontName { - const FX_CHAR* m_pName; + const char* m_pName; int m_Index; } g_AltFontNames[] = { {"Arial", 4}, @@ -138,8 +138,8 @@ const struct AltFontName { }; const struct AltFontFamily { - const FX_CHAR* m_pFontName; - const FX_CHAR* m_pFontFamily; + const char* m_pFontName; + const char* m_pFontFamily; } g_AltFontFamilies[] = { {"AGaramondPro", "Adobe Garamond Pro"}, {"BankGothicBT-Medium", "BankGothic Md BT"}, @@ -147,7 +147,7 @@ const struct AltFontFamily { }; const struct FX_FontStyle { - const FX_CHAR* style; + const char* style; int32_t len; } g_FontStyles[] = { {"Bold", 4}, {"Italic", 6}, {"BoldItalic", 10}, {"Reg", 3}, {"Regular", 7}, @@ -167,20 +167,19 @@ const struct CODEPAGE_MAP { }; int CompareFontFamilyString(const void* key, const void* element) { - CFX_ByteString str_key((const FX_CHAR*)key); + CFX_ByteString str_key((const char*)key); const AltFontFamily* family = reinterpret_cast<const AltFontFamily*>(element); if (str_key.Find(family->m_pFontName) != -1) return 0; - return FXSYS_stricmp(reinterpret_cast<const FX_CHAR*>(key), - family->m_pFontName); + return FXSYS_stricmp(reinterpret_cast<const char*>(key), family->m_pFontName); } int CompareString(const void* key, const void* element) { - return FXSYS_stricmp(reinterpret_cast<const FX_CHAR*>(key), + return FXSYS_stricmp(reinterpret_cast<const char*>(key), reinterpret_cast<const AltFontName*>(element)->m_pName); } -CFX_ByteString TT_NormalizeName(const FX_CHAR* family) { +CFX_ByteString TT_NormalizeName(const char* family) { CFX_ByteString norm(family); norm.Remove(' '); norm.Remove('-'); @@ -223,7 +222,7 @@ CFX_ByteString GetFontFamily(CFX_ByteString fontName, int nStyle) { return found ? CFX_ByteString(found->m_pFontFamily) : fontName; } -CFX_ByteString ParseStyle(const FX_CHAR* pStyle, int iLen, int iIndex) { +CFX_ByteString ParseStyle(const char* pStyle, int iLen, int iIndex) { CFX_ByteTextBuf buf; if (!iLen || iLen <= iIndex) return buf.MakeString(); @@ -505,7 +504,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, } if (!style.IsEmpty()) { int nLen = style.GetLength(); - const FX_CHAR* pStyle = style.c_str(); + const char* pStyle = style.c_str(); int i = 0; bool bFirstItem = true; CFX_ByteString buf; diff --git a/core/fxge/ge/cfx_fontmgr.cpp b/core/fxge/ge/cfx_fontmgr.cpp index 64f647e3f6..97d143804b 100644 --- a/core/fxge/ge/cfx_fontmgr.cpp +++ b/core/fxge/ge/cfx_fontmgr.cpp @@ -215,7 +215,7 @@ FXFT_Face CFX_FontMgr::GetFixedFace(const uint8_t* pData, return FXFT_Set_Pixel_Sizes(face, 64, 64) ? nullptr : face; } -FXFT_Face CFX_FontMgr::GetFileFace(const FX_CHAR* filename, int face_index) { +FXFT_Face CFX_FontMgr::GetFileFace(const char* filename, int face_index) { InitFTLibrary(); FXFT_Library library = m_FTLibrary; FXFT_Face face = nullptr; diff --git a/core/fxge/ge/cfx_unicodeencodingex.cpp b/core/fxge/ge/cfx_unicodeencodingex.cpp index c7e3303f02..cd7625fb17 100644 --- a/core/fxge/ge/cfx_unicodeencodingex.cpp +++ b/core/fxge/ge/cfx_unicodeencodingex.cpp @@ -62,7 +62,7 @@ uint32_t CFX_UnicodeEncodingEx::GlyphFromCharCode(uint32_t charcode) { return 0; } -uint32_t CFX_UnicodeEncodingEx::CharCodeFromUnicode(FX_WCHAR Unicode) const { +uint32_t CFX_UnicodeEncodingEx::CharCodeFromUnicode(wchar_t Unicode) const { if (m_nEncodingID == FXFM_ENCODING_UNICODE || m_nEncodingID == FXFM_ENCODING_MS_SYMBOL) { return Unicode; diff --git a/core/fxge/ge/fx_ge_linux.cpp b/core/fxge/ge/fx_ge_linux.cpp index e7086bb4e0..502a3674ab 100644 --- a/core/fxge/ge/fx_ge_linux.cpp +++ b/core/fxge/ge/fx_ge_linux.cpp @@ -15,7 +15,7 @@ namespace { const size_t kLinuxGpNameSize = 6; -const FX_CHAR* const g_LinuxGpFontList[][kLinuxGpNameSize] = { +const char* const g_LinuxGpFontList[][kLinuxGpNameSize] = { {"TakaoPGothic", "VL PGothic", "IPAPGothic", "VL Gothic", "Kochi Gothic", "VL Gothic regular"}, {"TakaoGothic", "VL Gothic", "IPAGothic", "Kochi Gothic", nullptr, @@ -26,19 +26,19 @@ const FX_CHAR* const g_LinuxGpFontList[][kLinuxGpNameSize] = { "VL Gothic regular"}, }; -const FX_CHAR* const g_LinuxGbFontList[] = { +const char* const g_LinuxGbFontList[] = { "AR PL UMing CN Light", "WenQuanYi Micro Hei", "AR PL UKai CN", }; -const FX_CHAR* const g_LinuxB5FontList[] = { +const char* const g_LinuxB5FontList[] = { "AR PL UMing TW Light", "WenQuanYi Micro Hei", "AR PL UKai TW", }; -const FX_CHAR* const g_LinuxHGFontList[] = { +const char* const g_LinuxHGFontList[] = { "UnDotum", }; -size_t GetJapanesePreference(const FX_CHAR* facearr, +size_t GetJapanesePreference(const char* facearr, int weight, int pitch_family) { CFX_ByteString face = facearr; @@ -72,7 +72,7 @@ class CFX_LinuxFontInfo : public CFX_FolderFontInfo { bool bItalic, int charset, int pitch_family, - const FX_CHAR* family, + const char* family, int& iExact) override; bool ParseFontCfg(const char** pUserPaths); }; @@ -81,7 +81,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, - const FX_CHAR* cstr_face, + const char* cstr_face, int& iExact) { void* font = GetSubstFont(cstr_face); if (font) { diff --git a/core/fxge/ge/fx_text_int.h b/core/fxge/ge/fx_text_int.h index 4de6587d41..8ea01f91d6 100644 --- a/core/fxge/ge/fx_text_int.h +++ b/core/fxge/ge/fx_text_int.h @@ -14,7 +14,7 @@ struct _CFX_UniqueKeyGen { void Generate(int count, ...); - FX_CHAR m_Key[128]; + char m_Key[128]; int m_KeyLen; }; diff --git a/core/fxge/ifx_systemfontinfo.h b/core/fxge/ifx_systemfontinfo.h index 1ab0ab677c..1453590148 100644 --- a/core/fxge/ifx_systemfontinfo.h +++ b/core/fxge/ifx_systemfontinfo.h @@ -27,7 +27,7 @@ class IFX_SystemFontInfo { bool bItalic, int charset, int pitch_family, - const FX_CHAR* face, + const char* face, int& iExact) = 0; #ifdef PDF_ENABLE_XFA @@ -37,7 +37,7 @@ class IFX_SystemFontInfo { int pitch_family); #endif // PDF_ENABLE_XFA - virtual void* GetFont(const FX_CHAR* face) = 0; + virtual void* GetFont(const char* face) = 0; virtual uint32_t GetFontData(void* hFont, uint32_t table, uint8_t* buffer, diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp index 74fae088d9..c3d2c66d9d 100644 --- a/core/fxge/win32/cfx_psrenderer.cpp +++ b/core/fxge/win32/cfx_psrenderer.cpp @@ -147,7 +147,7 @@ void CFX_PSRenderer::OutputPath(const CFX_PathData* pPathData, } } } - m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); + m_pOutput->OutputPS((const char*)buf.GetBuffer(), buf.GetSize()); } void CFX_PSRenderer::SetClip_PathFill(const CFX_PathData* pPathData, @@ -180,7 +180,7 @@ void CFX_PSRenderer::SetClip_PathStroke(const CFX_PathData* pPathData, buf << "mx Cm [" << pObject2Device->a << " " << pObject2Device->b << " " << pObject2Device->c << " " << pObject2Device->d << " " << pObject2Device->e << " " << pObject2Device->f << "]cm "; - m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); + m_pOutput->OutputPS((const char*)buf.GetBuffer(), buf.GetSize()); } OutputPath(pPathData, nullptr); CFX_FloatRect rect = pPathData->GetBoundingBox(pGraphState->m_LineWidth, @@ -219,7 +219,7 @@ bool CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData, buf << "mx Cm [" << pObject2Device->a << " " << pObject2Device->b << " " << pObject2Device->c << " " << pObject2Device->d << " " << pObject2Device->e << " " << pObject2Device->f << "]cm "; - m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); + m_pOutput->OutputPS((const char*)buf.GetBuffer(), buf.GetSize()); } } OutputPath(pPathData, stroke_alpha ? nullptr : pObject2Device); @@ -282,7 +282,7 @@ void CFX_PSRenderer::SetGraphState(const CFX_GraphStateData* pGraphState) { m_CurGraphState.Copy(*pGraphState); m_bGraphStateSet = true; if (buf.GetSize()) { - m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); + m_pOutput->OutputPS((const char*)buf.GetBuffer(), buf.GetSize()); } } @@ -306,7 +306,7 @@ static void PSCompressData(int PSLevel, uint32_t src_size, uint8_t** output_buf, uint32_t* output_size, - const FX_CHAR** filter) { + const char** filter) { *output_buf = src_buf; *output_size = src_size; *filter = ""; @@ -415,7 +415,7 @@ bool CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, } else { buf << "false 1 colorimage\n"; } - m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); + m_pOutput->OutputPS((const char*)buf.GetBuffer(), buf.GetSize()); WritePSBinary(output_buf.get(), output_size); output_buf.release(); } else { @@ -451,7 +451,7 @@ bool CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, int bpp = pConverted->GetBPP() / 8; uint8_t* output_buf = nullptr; FX_STRSIZE output_size = 0; - const FX_CHAR* filter = nullptr; + const char* filter = nullptr; if ((m_PSLevel == 2 || flags & FXRENDER_IMAGE_LOSSY) && CCodec_JpegModule::JpegEncode(pConverted.Get(), &output_buf, &output_size)) { @@ -493,7 +493,7 @@ bool CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, } buf << "false " << bpp; buf << " colorimage\n"; - m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); + m_pOutput->OutputPS((const char*)buf.GetBuffer(), buf.GetSize()); WritePSBinary(output_buf, output_size); FX_Free(output_buf); } @@ -518,7 +518,7 @@ void CFX_PSRenderer::SetColor(uint32_t color) { m_bColorSet = true; m_LastColor = color; } - m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); + m_pOutput->OutputPS((const char*)buf.GetBuffer(), buf.GetSize()); } } @@ -564,7 +564,7 @@ void CFX_PSRenderer::FindPSFontGlyph(CFX_FaceCache* pFaceCache, "currentdict end\n"; buf << "/X" << static_cast<uint32_t>(m_PSFontList.size() - 1) << " exch definefont pop\n"; - m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); + m_pOutput->OutputPS((const char*)buf.GetBuffer(), buf.GetSize()); buf.Clear(); } *ps_fontnum = m_PSFontList.size() - 1; @@ -625,7 +625,7 @@ void CFX_PSRenderer::FindPSFontGlyph(CFX_FaceCache* pFaceCache, buf << "f}bind def end\n"; buf << "/X" << *ps_fontnum << " Ff/Encoding get " << glyphindex << "/" << glyphindex << " put\n"; - m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); + m_pOutput->OutputPS((const char*)buf.GetBuffer(), buf.GetSize()); } bool CFX_PSRenderer::DrawText(int nChars, @@ -666,7 +666,7 @@ bool CFX_PSRenderer::DrawText(int nChars, buf << hex.AsStringC() << "Tj\n"; } buf << "Q\n"; - m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); + m_pOutput->OutputPS((const char*)buf.GetBuffer(), buf.GetSize()); pCache->ReleaseCachedFace(pFont); return true; } @@ -678,9 +678,9 @@ void CFX_PSRenderer::WritePSBinary(const uint8_t* data, int len) { if (pEncoders && pEncoders->GetBasicModule()->A85Encode(data, len, &dest_buf, &dest_size)) { - m_pOutput->OutputPS((const FX_CHAR*)dest_buf, dest_size); + m_pOutput->OutputPS((const char*)dest_buf, dest_size); FX_Free(dest_buf); } else { - m_pOutput->OutputPS((const FX_CHAR*)data, len); + m_pOutput->OutputPS((const char*)data, len); } } diff --git a/core/fxge/win32/cfx_windowsdib.h b/core/fxge/win32/cfx_windowsdib.h index 2564b7fa36..0bfab3fee1 100644 --- a/core/fxge/win32/cfx_windowsdib.h +++ b/core/fxge/win32/cfx_windowsdib.h @@ -20,7 +20,7 @@ typedef struct WINDIB_Open_Args_ { size_t memory_size; - const FX_WCHAR* path_name; + const wchar_t* path_name; } WINDIB_Open_Args_; class CFX_WindowsDIB : public CFX_DIBitmap { @@ -31,8 +31,8 @@ class CFX_WindowsDIB : public CFX_DIBitmap { static CFX_ByteString GetBitmapInfo(const CFX_DIBitmap* pBitmap); static CFX_DIBitmap* LoadFromBuf(BITMAPINFO* pbmi, void* pData); static HBITMAP GetDDBitmap(const CFX_DIBitmap* pBitmap, HDC hDC); - static CFX_DIBitmap* LoadFromFile(const FX_WCHAR* filename); - static CFX_DIBitmap* LoadFromFile(const FX_CHAR* filename); + static CFX_DIBitmap* LoadFromFile(const wchar_t* filename); + static CFX_DIBitmap* LoadFromFile(const char* filename); static CFX_DIBitmap* LoadDIBitmap(WINDIB_Open_Args_ args); HDC GetDC() const { return m_hMemDC; } diff --git a/core/fxge/win32/cpsoutput.cpp b/core/fxge/win32/cpsoutput.cpp index 76b37d7dac..24df15226b 100644 --- a/core/fxge/win32/cpsoutput.cpp +++ b/core/fxge/win32/cpsoutput.cpp @@ -20,13 +20,13 @@ void CPSOutput::Release() { delete this; } -void CPSOutput::OutputPS(const FX_CHAR* str, int len) { +void CPSOutput::OutputPS(const char* str, int len) { if (len < 0) len = static_cast<int>(FXSYS_strlen(str)); int sent_len = 0; while (len > 0) { - FX_CHAR buffer[1026]; + char buffer[1026]; int send_len = std::min(len, 1024); *(reinterpret_cast<uint16_t*>(buffer)) = send_len; FXSYS_memcpy(buffer + 2, str + sent_len, send_len); diff --git a/core/fxge/win32/cpsoutput.h b/core/fxge/win32/cpsoutput.h index bc9225bd7e..1a4709b36b 100644 --- a/core/fxge/win32/cpsoutput.h +++ b/core/fxge/win32/cpsoutput.h @@ -18,7 +18,7 @@ class CPSOutput { // IFX_PSOutput void Release(); - void OutputPS(const FX_CHAR* str, int len); + void OutputPS(const char* str, int len); HDC m_hDC; }; diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index 92e9b41e06..d1d81b18e4 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -34,15 +34,15 @@ namespace { const struct { - const FX_CHAR* m_pFaceName; - const FX_CHAR* m_pVariantName; + const char* m_pFaceName; + const char* m_pVariantName; } g_VariantNames[] = { {"DFKai-SB", "\x19\x6A\x77\x69\xD4\x9A"}, }; const struct { - const FX_CHAR* m_pName; - const FX_CHAR* m_pWinName; + const char* m_pName; + const char* m_pWinName; bool m_bBold; bool m_bItalic; } g_Base14Substs[] = { @@ -61,8 +61,8 @@ const struct { }; struct FontNameMap { - const FX_CHAR* m_pSubFontName; - const FX_CHAR* m_pSrcFontName; + const char* m_pSubFontName; + const char* m_pSrcFontName; }; const FontNameMap g_JpFontNameMap[] = { {"MS Mincho", "Heiseimin-W3"}, @@ -324,7 +324,7 @@ class CFX_Win32FallbackFontInfo final : public CFX_FolderFontInfo { bool bItalic, int charset, int pitch_family, - const FX_CHAR* family, + const char* family, int& iExact) override; }; @@ -339,9 +339,9 @@ class CFX_Win32FontInfo final : public IFX_SystemFontInfo { bool bItalic, int charset, int pitch_family, - const FX_CHAR* face, + const char* face, int& iExact) override; - void* GetFont(const FX_CHAR* face) override { return nullptr; } + void* GetFont(const char* face) override { return nullptr; } uint32_t GetFontData(void* hFont, uint32_t table, uint8_t* buffer, @@ -476,7 +476,7 @@ void* CFX_Win32FallbackFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, - const FX_CHAR* cstr_face, + const char* cstr_face, int& iExact) { void* font = GetSubstFont(cstr_face); if (font) { @@ -569,7 +569,7 @@ void* CFX_Win32FontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, - const FX_CHAR* cstr_face, + const char* cstr_face, int& iExact) { CFX_ByteString face = cstr_face; int iBaseFont; diff --git a/core/fxge/win32/fx_win32_dib.cpp b/core/fxge/win32/fx_win32_dib.cpp index 40c9ca6e31..9b85b57317 100644 --- a/core/fxge/win32/fx_win32_dib.cpp +++ b/core/fxge/win32/fx_win32_dib.cpp @@ -116,7 +116,7 @@ void GetBitmapSize(HBITMAP hBitmap, int& w, int& h) { h = bmp.bmHeight; } -CFX_DIBitmap* CFX_WindowsDIB::LoadFromFile(const FX_WCHAR* filename) { +CFX_DIBitmap* CFX_WindowsDIB::LoadFromFile(const wchar_t* filename) { CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData(); if (pPlatform->m_GdiplusExt.IsAvailable()) { @@ -150,7 +150,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadFromFile(const FX_WCHAR* filename) { return pDIBitmap; } -CFX_DIBitmap* CFX_WindowsDIB::LoadFromFile(const FX_CHAR* filename) { +CFX_DIBitmap* CFX_WindowsDIB::LoadFromFile(const char* filename) { return LoadFromFile(CFX_WideString::FromLocal(filename).c_str()); } diff --git a/core/fxge/win32/fx_win32_gdipext.cpp b/core/fxge/win32/fx_win32_gdipext.cpp index 1be2a54b18..1e51bba2b3 100644 --- a/core/fxge/win32/fx_win32_gdipext.cpp +++ b/core/fxge/win32/fx_win32_gdipext.cpp @@ -680,7 +680,7 @@ CGdiplusExt::CGdiplusExt() { } void CGdiplusExt::Load() { CFX_ByteString strPlusPath = ""; - FX_CHAR buf[MAX_PATH]; + char buf[MAX_PATH]; GetSystemDirectoryA(buf, MAX_PATH); strPlusPath += buf; strPlusPath += "\\"; @@ -765,7 +765,7 @@ bool CGdiplusExt::GdipCreateFromImage(void* bitmap, void** graphics) { } return false; } -bool CGdiplusExt::GdipCreateFontFamilyFromName(const FX_WCHAR* name, +bool CGdiplusExt::GdipCreateFontFamilyFromName(const wchar_t* name, void* pFontCollection, void** pFamily) { CGdiplusExt& GdiplusExt = diff --git a/core/fxge/win32/win32_int.h b/core/fxge/win32/win32_int.h index f8eae87308..08a8224db6 100644 --- a/core/fxge/win32/win32_int.h +++ b/core/fxge/win32/win32_int.h @@ -83,7 +83,7 @@ class CGdiplusExt { FX_FLOAT f, void** matrix); void GdipDeleteMatrix(void* matrix); - bool GdipCreateFontFamilyFromName(const FX_WCHAR* name, + bool GdipCreateFontFamilyFromName(const wchar_t* name, void* pFontCollection, void** pFamily); void GdipDeleteFontFamily(void* pFamily); |