summaryrefslogtreecommitdiff
path: root/core/src/fxge/ge
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fxge/ge')
-rw-r--r--core/src/fxge/ge/fx_ge.cpp2
-rw-r--r--core/src/fxge/ge/fx_ge_device.cpp6
-rw-r--r--core/src/fxge/ge/fx_ge_font.cpp14
-rw-r--r--core/src/fxge/ge/fx_ge_fontmap.cpp104
-rw-r--r--core/src/fxge/ge/fx_ge_linux.cpp32
-rw-r--r--core/src/fxge/ge/fx_ge_path.cpp10
-rw-r--r--core/src/fxge/ge/fx_ge_ps.cpp54
-rw-r--r--core/src/fxge/ge/fx_ge_text.cpp56
-rw-r--r--core/src/fxge/ge/text_int.h2
9 files changed, 140 insertions, 140 deletions
diff --git a/core/src/fxge/ge/fx_ge.cpp b/core/src/fxge/ge/fx_ge.cpp
index 4cfa95b881..5a9c8f53e5 100644
--- a/core/src/fxge/ge/fx_ge.cpp
+++ b/core/src/fxge/ge/fx_ge.cpp
@@ -68,7 +68,7 @@ void CFX_GEModule::SetTextGamma(FX_FLOAT gammaValue)
i++;
}
}
-FX_LPCBYTE CFX_GEModule::GetTextGammaTable()
+const uint8_t* CFX_GEModule::GetTextGammaTable()
{
return m_GammaValue;
}
diff --git a/core/src/fxge/ge/fx_ge_device.cpp b/core/src/fxge/ge/fx_ge_device.cpp
index 0b4ffd5f4c..8461396c1f 100644
--- a/core/src/fxge/ge/fx_ge_device.cpp
+++ b/core/src/fxge/ge/fx_ge_device.cpp
@@ -390,16 +390,16 @@ FX_BOOL CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int left,
return m_pDeviceDriver->StretchDIBits(pBitmap, argb, left, top, dest_width, dest_height, &clip_box, flags, alpha_flag, pIccTransform);
}
FX_BOOL CFX_RenderDevice::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD argb,
- const CFX_AffineMatrix* pMatrix, FX_DWORD flags, FX_LPVOID& handle,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_mode)
{
return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix, flags, handle, alpha_flag, pIccTransform, blend_mode);
}
-FX_BOOL CFX_RenderDevice::ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause)
+FX_BOOL CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause)
{
return m_pDeviceDriver->ContinueDIBits(handle, pPause);
}
-void CFX_RenderDevice::CancelDIBits(FX_LPVOID handle)
+void CFX_RenderDevice::CancelDIBits(void* handle)
{
m_pDeviceDriver->CancelDIBits(handle);
}
diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp
index 4c6da4edc3..c61119d5fe 100644
--- a/core/src/fxge/ge/fx_ge_font.cpp
+++ b/core/src/fxge/ge/fx_ge_font.cpp
@@ -8,7 +8,7 @@
#include "../../../include/fxge/fx_freetype.h"
#include "text_int.h"
#define EM_ADJUST(em, a) (em == 0?(a): (a)*1000/em)
-extern void _FPDFAPI_GetInternalFontData(int id1, FX_LPCBYTE& data, FX_DWORD& size);
+extern void _FPDFAPI_GetInternalFontData(int id1, const uint8_t*& data, FX_DWORD& size);
CFX_Font::CFX_Font()
{
m_pSubstFont = NULL;
@@ -189,7 +189,7 @@ int CFX_Font::GetGlyphWidth(FX_DWORD glyph_index)
int width = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Glyph_HoriAdvance(m_Face));
return width;
}
-static FXFT_Face FT_LoadFont(FX_LPBYTE pData, int size)
+static FXFT_Face FT_LoadFont(uint8_t* pData, int size)
{
FXFT_Library library;
if (CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary == NULL) {
@@ -207,12 +207,12 @@ static FXFT_Face FT_LoadFont(FX_LPBYTE pData, int size)
}
return face;
}
-FX_BOOL CFX_Font::LoadEmbedded(FX_LPCBYTE data, FX_DWORD size)
+FX_BOOL CFX_Font::LoadEmbedded(const uint8_t* data, FX_DWORD size)
{
m_pFontDataAllocation = FX_Alloc(uint8_t, size);
FXSYS_memcpy32(m_pFontDataAllocation, data, size);
- m_Face = FT_LoadFont((FX_LPBYTE)m_pFontDataAllocation, size);
- m_pFontData = (FX_LPBYTE)m_pFontDataAllocation;
+ m_Face = FT_LoadFont((uint8_t*)m_pFontDataAllocation, size);
+ m_pFontData = (uint8_t*)m_pFontDataAllocation;
m_bEmbedded = TRUE;
m_dwSize = size;
return m_Face != NULL;
@@ -540,7 +540,7 @@ FX_BOOL CFX_FontEncodingEX::IsUnicodeCompatible() const
{
return m_nEncodingID == FXFM_ENCODING_UNICODE;
}
-FX_DWORD CFX_FontEncodingEX::GlyphIndexFromName(FX_LPCSTR pStrName)
+FX_DWORD CFX_FontEncodingEX::GlyphIndexFromName(const FX_CHAR* pStrName)
{
FXFT_Face face = m_pFont->m_Face;
return FT_Get_Name_Index(face, (FT_String*)pStrName);
@@ -550,7 +550,7 @@ CFX_ByteString CFX_FontEncodingEX::NameFromGlyphIndex(FX_DWORD dwGlyphIndex)
FXFT_Face face = m_pFont->m_Face;
CFX_ByteString glyphName(" ");
if (FT_HAS_GLYPH_NAMES(((FT_Face)face))) {
- if (FT_Get_Glyph_Name((FT_Face)face, dwGlyphIndex, (FT_Pointer)(FX_LPCSTR)glyphName, 16)) {
+ if (FT_Get_Glyph_Name((FT_Face)face, dwGlyphIndex, (FT_Pointer)(const FX_CHAR*)glyphName, 16)) {
glyphName.Empty();
return glyphName;
}
diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp
index 4df7def3b9..620b82953c 100644
--- a/core/src/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/src/fxge/ge/fx_ge_fontmap.cpp
@@ -120,7 +120,7 @@ FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bT
CharsetCP, pSubstFont);
}
FXFT_Face CFX_FontMgr::GetCachedFace(const CFX_ByteString& face_name,
- int weight, FX_BOOL bItalic, FX_LPBYTE& pFontData)
+ int weight, FX_BOOL bItalic, uint8_t*& pFontData)
{
CFX_ByteString key(face_name);
key += ',';
@@ -136,7 +136,7 @@ FXFT_Face CFX_FontMgr::GetCachedFace(const CFX_ByteString& face_name,
return NULL;
}
FXFT_Face CFX_FontMgr::AddCachedFace(const CFX_ByteString& face_name,
- int weight, FX_BOOL bItalic, FX_LPBYTE pData, FX_DWORD size, int face_index)
+ int weight, FX_BOOL bItalic, uint8_t* pData, FX_DWORD size, int face_index)
{
CTTFontDesc* pFontDesc = FX_NEW CTTFontDesc;
if (!pFontDesc) {
@@ -170,7 +170,7 @@ FXFT_Face CFX_FontMgr::AddCachedFace(const CFX_ByteString& face_name,
m_FaceMap.SetAt(key, pFontDesc);
return pFontDesc->m_SingleFace.m_pFace;
}
-const FX_LPCSTR g_Base14FontNames[14] = {
+const FX_CHAR* const g_Base14FontNames[14] = {
"Courier",
"Courier-Bold",
"Courier-BoldOblique",
@@ -284,7 +284,7 @@ g_AltFontNames[] = {
extern "C" {
static int compareString(const void* key, const void* element)
{
- return FXSYS_stricmp((FX_LPCSTR)key, ((_AltFontName*)element)->m_pName);
+ return FXSYS_stricmp((const FX_CHAR*)key, ((_AltFontName*)element)->m_pName);
}
}
int _PDF_GetStandardFontName(CFX_ByteString& name)
@@ -297,10 +297,10 @@ int _PDF_GetStandardFontName(CFX_ByteString& name)
name = g_Base14FontNames[found->m_Index];
return found->m_Index;
}
-int GetTTCIndex(FX_LPCBYTE pFontData, FX_DWORD ttc_size, FX_DWORD font_offset)
+int GetTTCIndex(const uint8_t* pFontData, FX_DWORD ttc_size, FX_DWORD font_offset)
{
int face_index = 0;
- FX_LPCBYTE p = pFontData + 8;
+ const uint8_t* p = pFontData + 8;
FX_DWORD nfont = GET_TT_LONG(p);
FX_DWORD index;
for (index = 0; index < nfont; index ++) {
@@ -317,7 +317,7 @@ int GetTTCIndex(FX_LPCBYTE pFontData, FX_DWORD ttc_size, FX_DWORD font_offset)
return face_index;
}
FXFT_Face CFX_FontMgr::GetCachedTTCFace(int ttc_size, FX_DWORD checksum,
- int font_offset, FX_LPBYTE& pFontData)
+ int font_offset, uint8_t*& pFontData)
{
CFX_ByteString key;
key.Format("%d:%d", ttc_size, checksum);
@@ -335,7 +335,7 @@ FXFT_Face CFX_FontMgr::GetCachedTTCFace(int ttc_size, FX_DWORD checksum,
return pFontDesc->m_TTCFace.m_pFaces[face_index];
}
FXFT_Face CFX_FontMgr::AddCachedTTCFace(int ttc_size, FX_DWORD checksum,
- FX_LPBYTE pData, FX_DWORD size, int font_offset)
+ uint8_t* pData, FX_DWORD size, int font_offset)
{
CFX_ByteString key;
key.Format("%d:%d", ttc_size, checksum);
@@ -355,7 +355,7 @@ FXFT_Face CFX_FontMgr::AddCachedTTCFace(int ttc_size, FX_DWORD checksum,
pFontDesc->m_TTCFace.m_pFaces[face_index] = GetFixedFace(pFontDesc->m_pFontData, ttc_size, face_index);
return pFontDesc->m_TTCFace.m_pFaces[face_index];
}
-FXFT_Face CFX_FontMgr::GetFixedFace(FX_LPCBYTE pData, FX_DWORD size, int face_index)
+FXFT_Face CFX_FontMgr::GetFixedFace(const uint8_t* pData, FX_DWORD size, int face_index)
{
FXFT_Library library;
if (m_FTLibrary == NULL) {
@@ -373,7 +373,7 @@ FXFT_Face CFX_FontMgr::GetFixedFace(FX_LPCBYTE pData, FX_DWORD size, int face_in
}
return face;
}
-FXFT_Face CFX_FontMgr::GetFileFace(FX_LPCSTR filename, int face_index)
+FXFT_Face CFX_FontMgr::GetFileFace(const FX_CHAR* filename, int face_index)
{
FXFT_Library library;
if (m_FTLibrary == NULL) {
@@ -448,11 +448,11 @@ const FoxitFonts g_FoxitFonts[14] = {
{g_FoxitSymbolFontData, 16729},
{g_FoxitDingbatsFontData, 29513},
};
-void _FPDFAPI_GetInternalFontData(int id, FX_LPCBYTE& data, FX_DWORD& size)
+void _FPDFAPI_GetInternalFontData(int id, const uint8_t*& data, FX_DWORD& size)
{
CFX_GEModule::Get()->GetFontMgr()->GetStandardFont(data, size, id);
}
-FX_BOOL CFX_FontMgr::GetStandardFont(FX_LPCBYTE& pFontData, FX_DWORD& size, int index)
+FX_BOOL CFX_FontMgr::GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index)
{
if (index > 15 || index < 0) {
return FALSE;
@@ -507,7 +507,7 @@ void CFX_FontMapper::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo)
}
m_pFontInfo = pFontInfo;
}
-static CFX_ByteString _TT_NormalizeName(FX_LPCSTR family)
+static CFX_ByteString _TT_NormalizeName(const FX_CHAR* family)
{
CFX_ByteString norm(family, -1);
norm.Remove(' ');
@@ -520,12 +520,12 @@ static CFX_ByteString _TT_NormalizeName(FX_LPCSTR family)
norm.MakeLower();
return norm;
}
-CFX_ByteString _FPDF_GetNameFromTT(FX_LPCBYTE name_table, FX_DWORD name_id)
+CFX_ByteString _FPDF_GetNameFromTT(const uint8_t* name_table, FX_DWORD name_id)
{
- FX_LPCBYTE ptr = name_table + 2;
+ const uint8_t* ptr = name_table + 2;
int name_count = GET_TT_SHORT(ptr);
int string_offset = GET_TT_SHORT(ptr + 2);
- FX_LPCBYTE string_ptr = name_table + string_offset;
+ const uint8_t* string_ptr = name_table + string_offset;
ptr += 4;
for (int i = 0; i < name_count; i ++) {
if (GET_TT_SHORT(ptr + 6) == name_id && GET_TT_SHORT(ptr) == 1 && GET_TT_SHORT(ptr + 2) == 0) {
@@ -544,10 +544,10 @@ static CFX_ByteString _FPDF_ReadStringFromFile(FXSYS_FILE* pFile, FX_DWORD size)
buffer.ReleaseBuffer(size);
return buffer;
}
-CFX_ByteString _FPDF_LoadTableFromTT(FXSYS_FILE* pFile, FX_LPCBYTE pTables, FX_DWORD nTables, FX_DWORD tag)
+CFX_ByteString _FPDF_LoadTableFromTT(FXSYS_FILE* pFile, const uint8_t* pTables, FX_DWORD nTables, FX_DWORD tag)
{
for (FX_DWORD i = 0; i < nTables; i ++) {
- FX_LPCBYTE p = pTables + i * 16;
+ const uint8_t* p = pTables + i * 16;
if (GET_TT_LONG(p) == tag) {
FX_DWORD offset = GET_TT_LONG(p + 8);
FX_DWORD size = GET_TT_LONG(p + 12);
@@ -557,10 +557,10 @@ CFX_ByteString _FPDF_LoadTableFromTT(FXSYS_FILE* pFile, FX_LPCBYTE pTables, FX_D
}
return CFX_ByteString();
}
-CFX_ByteString _FPDF_LoadTableFromTTStreamFile(IFX_FileStream* pFile, FX_LPCBYTE pTables, FX_DWORD nTables, FX_DWORD tag)
+CFX_ByteString _FPDF_LoadTableFromTTStreamFile(IFX_FileStream* pFile, const uint8_t* pTables, FX_DWORD nTables, FX_DWORD tag)
{
for (FX_DWORD i = 0; i < nTables; i ++) {
- FX_LPCBYTE p = pTables + i * 16;
+ const uint8_t* p = pTables + i * 16;
if (GET_TT_LONG(p) == tag) {
FX_DWORD offset = GET_TT_LONG(p + 8);
FX_DWORD size = GET_TT_LONG(p + 12);
@@ -582,7 +582,7 @@ CFX_ByteString CFX_FontMapper::GetPSNameFromTT(void* hFont)
CFX_ByteString result;
FX_DWORD size = m_pFontInfo->GetFontData(hFont, 0x6e616d65, NULL, 0);
if (size) {
- FX_LPBYTE buffer = FX_Alloc(uint8_t, size);
+ uint8_t* buffer = FX_Alloc(uint8_t, size);
m_pFontInfo->GetFontData(hFont, 0x6e616d65, buffer, size);
result = _FPDF_GetNameFromTT(buffer, 6);
FX_Free(buffer);
@@ -601,7 +601,7 @@ void CFX_FontMapper::AddInstalledFont(const CFX_ByteString& name, int charset)
if (name == m_LastFamily) {
return;
}
- FX_LPCBYTE ptr = name;
+ const uint8_t* ptr = name;
FX_BOOL bLocalized = FALSE;
for (int i = 0; i < name.GetLength(); i ++)
if (ptr[i] > 0x80) {
@@ -761,7 +761,7 @@ FXFT_Face CFX_FontMapper::UseInternalSubst(CFX_SubstFont* pSubstFont, int iBaseF
if (m_FoxitFaces[iBaseFont]) {
return m_FoxitFaces[iBaseFont];
}
- FX_LPCBYTE pFontData = NULL;
+ const uint8_t* pFontData = NULL;
FX_DWORD size = 0;
if (m_pFontMgr->GetStandardFont(pFontData, size, iBaseFont)) {
m_FoxitFaces[iBaseFont] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
@@ -779,7 +779,7 @@ FXFT_Face CFX_FontMapper::UseInternalSubst(CFX_SubstFont* pSubstFont, int iBaseF
if (m_MMFaces[1]) {
return m_MMFaces[1];
}
- FX_LPCBYTE pFontData = NULL;
+ const uint8_t* pFontData = NULL;
FX_DWORD size;
m_pFontMgr->GetStandardFont(pFontData, size, 14);
m_MMFaces[1] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
@@ -789,15 +789,15 @@ FXFT_Face CFX_FontMapper::UseInternalSubst(CFX_SubstFont* pSubstFont, int iBaseF
if (m_MMFaces[0]) {
return m_MMFaces[0];
}
- FX_LPCBYTE pFontData = NULL;
+ const uint8_t* pFontData = NULL;
FX_DWORD size = 0;
m_pFontMgr->GetStandardFont(pFontData, size, 15);
m_MMFaces[0] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
return m_MMFaces[0];
}
const struct _AltFontFamily {
- FX_LPCSTR m_pFontName;
- FX_LPCSTR m_pFontFamily;
+ const FX_CHAR* m_pFontName;
+ const FX_CHAR* m_pFontFamily;
}
g_AltFontFamilies[] = {
{"AGaramondPro", "Adobe Garamond Pro"},
@@ -807,11 +807,11 @@ g_AltFontFamilies[] = {
extern "C" {
static int compareFontFamilyString(const void* key, const void* element)
{
- CFX_ByteString str_key((FX_LPCSTR)key);
+ CFX_ByteString str_key((const FX_CHAR*)key);
if (str_key.Find(((_AltFontFamily*)element)->m_pFontName) != -1) {
return 0;
}
- return FXSYS_stricmp((FX_LPCSTR)key, ((_AltFontFamily*)element)->m_pFontName);
+ return FXSYS_stricmp((const FX_CHAR*)key, ((_AltFontFamily*)element)->m_pFontName);
}
}
#define FX_FONT_STYLE_None 0x00
@@ -840,7 +840,7 @@ static CFX_ByteString _GetFontFamily(CFX_ByteString fontName, int nStyle)
return found->m_pFontFamily;
};
typedef struct _FX_FontStyle {
- FX_LPCSTR style;
+ const FX_CHAR* style;
int32_t len;
} FX_FontStyle;
const FX_FontStyle g_FontStyles[] = {
@@ -850,7 +850,7 @@ const FX_FontStyle g_FontStyles[] = {
{ "Reg", 3 },
{ "Regular", 7 },
};
-CFX_ByteString ParseStyle(FX_LPCSTR pStyle, int iLen, int iIndex)
+CFX_ByteString ParseStyle(const FX_CHAR* pStyle, int iLen, int iIndex)
{
CFX_ByteTextBuf buf;
if (!iLen || iLen <= iIndex) {
@@ -920,7 +920,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
if (m_FoxitFaces[12]) {
return m_FoxitFaces[12];
}
- FX_LPCBYTE pFontData = NULL;
+ const uint8_t* pFontData = NULL;
FX_DWORD size = 0;
m_pFontMgr->GetStandardFont(pFontData, size, 12);
m_FoxitFaces[12] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
@@ -933,7 +933,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
if (m_FoxitFaces[13]) {
return m_FoxitFaces[13];
}
- FX_LPCBYTE pFontData = NULL;
+ const uint8_t* pFontData = NULL;
FX_DWORD size = 0;
m_pFontMgr->GetStandardFont(pFontData, size, 13);
m_FoxitFaces[13] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
@@ -1011,7 +1011,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
}
if (!style.IsEmpty()) {
int nLen = style.GetLength();
- FX_LPCSTR pStyle = style;
+ const FX_CHAR* pStyle = style;
int i = 0;
FX_BOOL bFirstItem = TRUE;
CFX_ByteString buf;
@@ -1176,7 +1176,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
if (m_FoxitFaces[12]) {
return m_FoxitFaces[12];
}
- FX_LPCBYTE pFontData = NULL;
+ const uint8_t* pFontData = NULL;
FX_DWORD size = 0;
m_pFontMgr->GetStandardFont(pFontData, size, 12);
m_FoxitFaces[12] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
@@ -1224,7 +1224,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
for (int i = 0; i < 256; i ++) {
checksum += ((FX_DWORD*)temp)[i];
}
- FX_LPBYTE pFontData;
+ uint8_t* pFontData;
face = m_pFontMgr->GetCachedTTCFace(ttc_size, checksum, ttc_size - font_size, pFontData);
if (face == NULL) {
pFontData = FX_Alloc(uint8_t, ttc_size);
@@ -1233,7 +1233,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
ttc_size - font_size);
}
} else {
- FX_LPBYTE pFontData;
+ uint8_t* pFontData;
face = m_pFontMgr->GetCachedFace(SubstName, weight, bItalic, pFontData);
if (face == NULL) {
pFontData = FX_Alloc(uint8_t, font_size);
@@ -1309,7 +1309,7 @@ FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(FX_DWORD dwUnicode, FX_DWORD fl
for (int i = 0; i < 256; i ++) {
checksum += ((FX_DWORD*)temp)[i];
}
- FX_LPBYTE pFontData;
+ uint8_t* pFontData;
face = m_pFontMgr->GetCachedTTCFace(ttc_size, checksum, ttc_size - font_size, pFontData);
if (face == NULL) {
pFontData = FX_Alloc(uint8_t, ttc_size);
@@ -1322,7 +1322,7 @@ FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(FX_DWORD dwUnicode, FX_DWORD fl
} else {
CFX_ByteString SubstName;
m_pFontInfo->GetFaceName(hFont, SubstName);
- FX_LPBYTE pFontData;
+ uint8_t* pFontData;
face = m_pFontMgr->GetCachedFace(SubstName, weight, bItalic, pFontData);
if (face == NULL) {
pFontData = FX_Alloc(uint8_t, font_size);
@@ -1390,7 +1390,7 @@ CFX_FolderFontInfo::~CFX_FolderFontInfo()
FX_POSITION pos = m_FontList.GetStartPosition();
while (pos) {
CFX_ByteString key;
- FX_LPVOID value;
+ void* value;
m_FontList.GetNextAssoc(pos, key, value);
delete (CFontFaceInfo*)value;
}
@@ -1469,7 +1469,7 @@ void CFX_FolderFontInfo::ScanFile(CFX_ByteString& path)
return;
}
FX_DWORD face_bytes = nFaces * 4;
- FX_LPBYTE offsets = FX_Alloc(uint8_t, face_bytes);
+ uint8_t* offsets = FX_Alloc(uint8_t, face_bytes);
readCnt = FXSYS_fread(offsets, face_bytes, 1, pFile);
if (readCnt != face_bytes) {
FX_Free(offsets);
@@ -1477,7 +1477,7 @@ void CFX_FolderFontInfo::ScanFile(CFX_ByteString& path)
return;
}
for (FX_DWORD i = 0; i < nFaces; i ++) {
- FX_LPBYTE p = offsets + i * 4;
+ uint8_t* p = offsets + i * 4;
ReportFace(path, pFile, filesize, GET_TT_LONG(p));
}
FX_Free(offsets);
@@ -1504,7 +1504,7 @@ void CFX_FolderFontInfo::ReportFace(CFX_ByteString& path, FXSYS_FILE* pFile, FX_
if (style != "Regular") {
facename += " " + style;
}
- FX_LPVOID p;
+ void* p;
if (m_FontList.Lookup(facename, p)) {
return;
}
@@ -1520,7 +1520,7 @@ void CFX_FolderFontInfo::ReportFace(CFX_ByteString& path, FXSYS_FILE* pFile, FX_
pInfo->m_Charsets = 0;
CFX_ByteString os2 = _FPDF_LoadTableFromTT(pFile, tables, nTables, 0x4f532f32);
if (os2.GetLength() >= 86) {
- FX_LPCBYTE p = (FX_LPCBYTE)os2 + 78;
+ const uint8_t* p = (const uint8_t*)os2 + 78;
FX_DWORD codepages = GET_TT_LONG(p);
if (codepages & (1 << 17)) {
m_pMapper->AddInstalledFont(facename, FXFONT_SHIFTJIS_CHARSET);
@@ -1557,23 +1557,23 @@ void CFX_FolderFontInfo::ReportFace(CFX_ByteString& path, FXSYS_FILE* pFile, FX_
}
m_FontList.SetAt(facename, pInfo);
}
-void* CFX_FolderFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL& bExact)
+void* CFX_FolderFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL& bExact)
{
return NULL;
}
void* CFX_FolderFontInfo::MapFontByUnicode(FX_DWORD dwUnicode, int weight, FX_BOOL bItalic, int pitch_family)
-{
- return NULL;
-}
-void* CFX_FolderFontInfo::GetFont(FX_LPCSTR face)
{
- FX_LPVOID p;
+ return NULL;
+}
+void* CFX_FolderFontInfo::GetFont(const FX_CHAR* face)
+{
+ void* p;
if (!m_FontList.Lookup(face, p)) {
return NULL;
}
return p;
}
-FX_DWORD CFX_FolderFontInfo::GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size)
+FX_DWORD CFX_FolderFontInfo::GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer, FX_DWORD size)
{
if (hFont == NULL) {
return 0;
@@ -1597,7 +1597,7 @@ FX_DWORD CFX_FolderFontInfo::GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE
} else {
FX_DWORD nTables = pFont->m_FontTables.GetLength() / 16;
for (FX_DWORD i = 0; i < nTables; i ++) {
- FX_LPCBYTE p = (FX_LPCBYTE)pFont->m_FontTables + i * 16;
+ const uint8_t* p = (const uint8_t*)pFont->m_FontTables + i * 16;
if (GET_TT_LONG(p) == table) {
offset = GET_TT_LONG(p + 8);
datasize = GET_TT_LONG(p + 12);
diff --git a/core/src/fxge/ge/fx_ge_linux.cpp b/core/src/fxge/ge/fx_ge_linux.cpp
index 5a0f0dffa5..5eac00f8dd 100644
--- a/core/src/fxge/ge/fx_ge_linux.cpp
+++ b/core/src/fxge/ge/fx_ge_linux.cpp
@@ -9,8 +9,8 @@
#include "text_int.h"
#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_
static const struct {
- FX_LPCSTR m_pName;
- FX_LPCSTR m_pSubstName;
+ const FX_CHAR* m_pName;
+ const FX_CHAR* m_pSubstName;
}
Base14Substs[] = {
{"Courier", "Courier New"},
@@ -29,13 +29,13 @@ Base14Substs[] = {
class CFX_LinuxFontInfo : public CFX_FolderFontInfo
{
public:
- virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL& bExact);
+ virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL& bExact);
FX_BOOL ParseFontCfg();
- void* FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL bMatchName);
+ void* FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL bMatchName);
};
#define LINUX_GPNAMESIZE 6
static const struct {
- FX_LPCSTR NameArr[LINUX_GPNAMESIZE];
+ const FX_CHAR* NameArr[LINUX_GPNAMESIZE];
}
LinuxGpFontList[] = {
{{"TakaoPGothic", "VL PGothic", "IPAPGothic", "VL Gothic", "Kochi Gothic", "VL Gothic regular"}},
@@ -43,20 +43,20 @@ LinuxGpFontList[] = {
{{"TakaoPMincho", "IPAPMincho", "VL Gothic", "Kochi Mincho", NULL, "VL Gothic regular"}},
{{"TakaoMincho", "IPAMincho", "VL Gothic", "Kochi Mincho", NULL, "VL Gothic regular"}},
};
-static const FX_LPCSTR g_LinuxGbFontList[] = {
+static const FX_CHAR* const g_LinuxGbFontList[] = {
"AR PL UMing CN Light",
"WenQuanYi Micro Hei",
"AR PL UKai CN",
};
-static const FX_LPCSTR g_LinuxB5FontList[] = {
+static const FX_CHAR* const g_LinuxB5FontList[] = {
"AR PL UMing TW Light",
"WenQuanYi Micro Hei",
"AR PL UKai TW",
};
-static const FX_LPCSTR g_LinuxHGFontList[] = {
+static const FX_CHAR* const g_LinuxHGFontList[] = {
"UnDotum",
};
-static int32_t GetJapanesePreference(FX_LPCSTR facearr, int weight, int picth_family)
+static int32_t GetJapanesePreference(const FX_CHAR* facearr, int weight, int picth_family)
{
CFX_ByteString face = facearr;
if (face.Find("Gothic") >= 0 || face.Find("\x83\x53\x83\x56\x83\x62\x83\x4e") >= 0) {
@@ -77,7 +77,7 @@ static int32_t GetJapanesePreference(FX_LPCSTR facearr, int weight, int picth_fa
}
return 2;
}
-void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR cstr_face, FX_BOOL& bExact)
+void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, FX_BOOL& bExact)
{
CFX_ByteString face = cstr_face;
int iBaseFont;
@@ -90,7 +90,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int p
if (iBaseFont < 12) {
return GetFont(face);
}
- FX_LPVOID p = NULL;
+ void* p = NULL;
FX_BOOL bCJK = TRUE;
switch (charset) {
case FXFONT_SHIFTJIS_CHARSET: {
@@ -105,7 +105,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int p
}
break;
case FXFONT_GB2312_CHARSET: {
- static int32_t s_gbCount = sizeof(g_LinuxGbFontList) / sizeof(FX_LPCSTR);
+ static int32_t s_gbCount = sizeof(g_LinuxGbFontList) / sizeof(const FX_CHAR*);
for (int32_t i = 0; i < s_gbCount; i++)
if (m_FontList.Lookup(g_LinuxGbFontList[i], p)) {
return p;
@@ -113,7 +113,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int p
}
break;
case FXFONT_CHINESEBIG5_CHARSET: {
- static int32_t s_b5Count = sizeof(g_LinuxB5FontList) / sizeof(FX_LPCSTR);
+ static int32_t s_b5Count = sizeof(g_LinuxB5FontList) / sizeof(const FX_CHAR*);
for (int32_t i = 0; i < s_b5Count; i++)
if (m_FontList.Lookup(g_LinuxB5FontList[i], p)) {
return p;
@@ -121,7 +121,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int p
}
break;
case FXFONT_HANGEUL_CHARSET: {
- static int32_t s_hgCount = sizeof(g_LinuxHGFontList) / sizeof(FX_LPCSTR);
+ static int32_t s_hgCount = sizeof(g_LinuxHGFontList) / sizeof(const FX_CHAR*);
for (int32_t i = 0; i < s_hgCount; i++)
if (m_FontList.Lookup(g_LinuxHGFontList[i], p)) {
return p;
@@ -177,7 +177,7 @@ static int32_t _LinuxGetSimilarValue(int weight, FX_BOOL bItalic, int pitch_fami
}
return iSimilarValue;
}
-void* CFX_LinuxFontInfo::FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL bMatchName)
+void* CFX_LinuxFontInfo::FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL bMatchName)
{
CFontFaceInfo* pFind = NULL;
FX_DWORD charset_flag = _LinuxGetCharset(charset);
@@ -186,7 +186,7 @@ void* CFX_LinuxFontInfo::FindFont(int weight, FX_BOOL bItalic, int charset, int
while (pos) {
CFX_ByteString bsName;
CFontFaceInfo* pFont = NULL;
- m_FontList.GetNextAssoc(pos, bsName, (FX_LPVOID&)pFont);
+ m_FontList.GetNextAssoc(pos, bsName, (void*&)pFont);
if (!(pFont->m_Charsets & charset_flag) && charset != FXFONT_DEFAULT_CHARSET) {
continue;
}
diff --git a/core/src/fxge/ge/fx_ge_path.cpp b/core/src/fxge/ge/fx_ge_path.cpp
index 51d5908a81..4ae7b42b39 100644
--- a/core/src/fxge/ge/fx_ge_path.cpp
+++ b/core/src/fxge/ge/fx_ge_path.cpp
@@ -65,8 +65,8 @@ void CFX_ClipRgn::IntersectMaskRect(FX_RECT rect, FX_RECT mask_rect, CFX_DIBitma
}
new_dib->Create(m_Box.Width(), m_Box.Height(), FXDIB_8bppMask);
for (int row = m_Box.top; row < m_Box.bottom; row ++) {
- FX_LPBYTE dest_scan = new_dib->GetBuffer() + new_dib->GetPitch() * (row - m_Box.top);
- FX_LPBYTE src_scan = mask_dib->GetBuffer() + mask_dib->GetPitch() * (row - mask_rect.top);
+ uint8_t* dest_scan = new_dib->GetBuffer() + new_dib->GetPitch() * (row - m_Box.top);
+ uint8_t* src_scan = mask_dib->GetBuffer() + mask_dib->GetPitch() * (row - mask_rect.top);
for (int col = m_Box.left; col < m_Box.right; col ++) {
dest_scan[col - m_Box.left] = src_scan[col - mask_rect.left];
}
@@ -98,9 +98,9 @@ void CFX_ClipRgn::IntersectMaskF(int left, int top, CFX_DIBitmapRef Mask)
new_dib->Create(new_box.Width(), new_box.Height(), FXDIB_8bppMask);
const CFX_DIBitmap* old_dib = m_Mask;
for (int row = new_box.top; row < new_box.bottom; row ++) {
- FX_LPBYTE old_scan = old_dib->GetBuffer() + (row - m_Box.top) * old_dib->GetPitch();
- FX_LPBYTE mask_scan = mask_dib->GetBuffer() + (row - top) * mask_dib->GetPitch();
- FX_LPBYTE new_scan = new_dib->GetBuffer() + (row - new_box.top) * new_dib->GetPitch();
+ uint8_t* old_scan = old_dib->GetBuffer() + (row - m_Box.top) * old_dib->GetPitch();
+ uint8_t* mask_scan = mask_dib->GetBuffer() + (row - top) * mask_dib->GetPitch();
+ uint8_t* new_scan = new_dib->GetBuffer() + (row - new_box.top) * new_dib->GetPitch();
for (int col = new_box.left; col < new_box.right; col ++) {
new_scan[col - new_box.left] = old_scan[col - m_Box.left] * mask_scan[col - left] / 255;
}
diff --git a/core/src/fxge/ge/fx_ge_ps.cpp b/core/src/fxge/ge/fx_ge_ps.cpp
index 4ff40211d0..0e25d7e2e8 100644
--- a/core/src/fxge/ge/fx_ge_ps.cpp
+++ b/core/src/fxge/ge/fx_ge_ps.cpp
@@ -131,7 +131,7 @@ void CFX_PSRenderer::OutputPath(const CFX_PathData* pPathData, const CFX_AffineM
}
}
}
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
}
void CFX_PSRenderer::SetClip_PathFill(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
@@ -163,7 +163,7 @@ void CFX_PSRenderer::SetClip_PathStroke(const CFX_PathData* pPathData,
buf << FX_BSTRC("mx Cm [") << pObject2Device->a << FX_BSTRC(" ") << pObject2Device->b << FX_BSTRC(" ") <<
pObject2Device->c << FX_BSTRC(" ") << pObject2Device->d << FX_BSTRC(" ") << pObject2Device->e <<
FX_BSTRC(" ") << pObject2Device->f << FX_BSTRC("]cm ");
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
}
OutputPath(pPathData, NULL);
CFX_FloatRect rect = pPathData->GetBoundingBox(pGraphState->m_LineWidth, pGraphState->m_MiterLimit);
@@ -204,7 +204,7 @@ FX_BOOL CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
buf << FX_BSTRC("mx Cm [") << pObject2Device->a << FX_BSTRC(" ") << pObject2Device->b << FX_BSTRC(" ") <<
pObject2Device->c << FX_BSTRC(" ") << pObject2Device->d << FX_BSTRC(" ") << pObject2Device->e <<
FX_BSTRC(" ") << pObject2Device->f << FX_BSTRC("]cm ");
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
}
}
OutputPath(pPathData, stroke_alpha ? NULL : pObject2Device);
@@ -261,10 +261,10 @@ void CFX_PSRenderer::SetGraphState(const CFX_GraphStateData* pGraphState)
m_CurGraphState.Copy(*pGraphState);
m_bGraphStateSet = TRUE;
if (buf.GetSize()) {
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
}
}
-static void FaxCompressData(FX_LPBYTE src_buf, int width, int height, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+static void FaxCompressData(uint8_t* src_buf, int width, int height, uint8_t*& dest_buf, FX_DWORD& dest_size)
{
CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
if (width * height > 128 && pEncoders && pEncoders->GetFaxModule()->Encode(src_buf, width, height, (width + 7) / 8, dest_buf, dest_size)) {
@@ -274,8 +274,8 @@ static void FaxCompressData(FX_LPBYTE src_buf, int width, int height, FX_LPBYTE&
dest_size = (width + 7) / 8 * height;
}
}
-static void PSCompressData(int PSLevel, FX_LPBYTE src_buf, FX_DWORD src_size,
- FX_LPBYTE& output_buf, FX_DWORD& output_size, FX_LPCSTR& filter)
+static void PSCompressData(int PSLevel, uint8_t* src_buf, FX_DWORD src_size,
+ uint8_t*& output_buf, FX_DWORD& output_size, const FX_CHAR*& filter)
{
output_buf = src_buf;
output_size = src_size;
@@ -284,7 +284,7 @@ static void PSCompressData(int PSLevel, FX_LPBYTE src_buf, FX_DWORD src_size,
return;
}
CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
- FX_LPBYTE dest_buf = NULL;
+ uint8_t* dest_buf = NULL;
FX_DWORD dest_size = src_size;
if (PSLevel >= 3) {
if (pEncoders && pEncoders->GetFlateModule()->Encode(src_buf, src_size, dest_buf, dest_size)) {
@@ -348,12 +348,12 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
if (pSource->GetBPP() == 1 && pSource->GetPalette() == NULL) {
int pitch = (width + 7) / 8;
FX_DWORD src_size = height * pitch;
- FX_LPBYTE src_buf = FX_Alloc(uint8_t, src_size);
+ uint8_t* src_buf = FX_Alloc(uint8_t, src_size);
for (int row = 0; row < height; row ++) {
- FX_LPCBYTE src_scan = pSource->GetScanline(row);
+ const uint8_t* src_scan = pSource->GetScanline(row);
FXSYS_memcpy32(src_buf + row * pitch, src_scan, pitch);
}
- FX_LPBYTE output_buf;
+ uint8_t* output_buf;
FX_DWORD output_size;
FaxCompressData(src_buf, width, height, output_buf, output_size);
if (pSource->IsAlphaMask()) {
@@ -373,7 +373,7 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
} else {
buf << FX_BSTRC("false 1 colorimage\n");
}
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
WritePSBinary(output_buf, output_size);
FX_Free(output_buf);
} else {
@@ -409,9 +409,9 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
return FALSE;
}
int Bpp = pConverted->GetBPP() / 8;
- FX_LPBYTE output_buf = NULL;
+ uint8_t* output_buf = NULL;
FX_STRSIZE output_size = 0;
- FX_LPCSTR filter = NULL;
+ const FX_CHAR* filter = NULL;
if (flags & FXRENDER_IMAGE_LOSSY) {
CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
if (pEncoders && pEncoders->GetJpegModule()->Encode(pConverted, output_buf, output_size)) {
@@ -423,8 +423,8 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
output_size = height * src_pitch;
output_buf = FX_Alloc(uint8_t, output_size);
for (int row = 0; row < height; row ++) {
- FX_LPCBYTE src_scan = pConverted->GetScanline(row);
- FX_LPBYTE dest_scan = output_buf + row * src_pitch;
+ const uint8_t* src_scan = pConverted->GetScanline(row);
+ uint8_t* dest_scan = output_buf + row * src_pitch;
if (Bpp == 3) {
for (int col = 0; col < width; col ++) {
*dest_scan++ = src_scan[2];
@@ -436,7 +436,7 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
FXSYS_memcpy32(dest_scan, src_scan, src_pitch);
}
}
- FX_LPBYTE compressed_buf;
+ uint8_t* compressed_buf;
FX_DWORD compressed_size;
PSCompressData(m_PSLevel, output_buf, output_size, compressed_buf, compressed_size, filter);
if (output_buf != compressed_buf) {
@@ -457,7 +457,7 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
}
buf << FX_BSTRC("false ") << Bpp;
buf << FX_BSTRC(" colorimage\n");
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
WritePSBinary(output_buf, output_size);
FX_Free(output_buf);
}
@@ -473,7 +473,7 @@ void CFX_PSRenderer::SetColor(FX_DWORD color, int alpha_flag, void* pIccTransfor
if (pIccTransform) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
color = FXGETFLAG_COLORTYPE(alpha_flag) ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
- FX_LPBYTE pColor = (FX_LPBYTE)&color;
+ uint8_t* pColor = (uint8_t*)&color;
pIccModule->TranslateScanline(pIccTransform, pColor, pColor, 1);
color = m_bCmykOutput ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
bCMYK = m_bCmykOutput;
@@ -493,7 +493,7 @@ void CFX_PSRenderer::SetColor(FX_DWORD color, int alpha_flag, void* pIccTransfor
m_bColorSet = TRUE;
m_LastColor = color;
}
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
}
}
void CFX_PSRenderer::FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_Font* pFont, const FXTEXT_CHARPOS& charpos,
@@ -530,7 +530,7 @@ void CFX_PSRenderer::FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_Font* pFont,
"/BuildChar{1 index/Encoding get exch get 1 index/BuildGlyph get exec}bind def\n"
"currentdict end\n");
buf << FX_BSTRC("/X") << m_PSFontList.GetSize() - 1 << FX_BSTRC(" exch definefont pop\n");
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
buf.Clear();
}
ps_fontnum = m_PSFontList.GetSize() - 1;
@@ -589,7 +589,7 @@ void CFX_PSRenderer::FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_Font* pFont,
buf << FX_BSTRC("}bind def end\n");
buf << FX_BSTRC("/X") << ps_fontnum << FX_BSTRC(" Ff/Encoding get ") << ps_glyphindex
<< FX_BSTRC("/") << ps_glyphindex << FX_BSTRC(" put\n");
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
}
FX_BOOL CFX_PSRenderer::DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device,
@@ -630,18 +630,18 @@ FX_BOOL CFX_PSRenderer::DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX
buf << hex << FX_BSTRC("Tj\n");
}
buf << FX_BSTRC("Q\n");
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
return TRUE;
}
-void CFX_PSRenderer::WritePSBinary(FX_LPCBYTE data, int len)
+void CFX_PSRenderer::WritePSBinary(const uint8_t* data, int len)
{
- FX_LPBYTE dest_buf;
+ uint8_t* dest_buf;
FX_DWORD dest_size;
CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
if (pEncoders && pEncoders->GetBasicModule()->A85Encode(data, len, dest_buf, dest_size)) {
- m_pOutput->OutputPS((FX_LPCSTR)dest_buf, dest_size);
+ m_pOutput->OutputPS((const FX_CHAR*)dest_buf, dest_size);
FX_Free(dest_buf);
} else {
- m_pOutput->OutputPS((FX_LPCSTR)data, len);
+ m_pOutput->OutputPS((const FX_CHAR*)data, len);
}
}
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index 1aabbedd5b..151b7099a5 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -111,7 +111,7 @@ void _Color2Argb(FX_ARGB& argb, FX_DWORD color, int alpha_flag, void* pIccTransf
if (pIccTransform) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
color = FXGETFLAG_COLORTYPE(alpha_flag) ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
- pIccModule->TranslateScanline(pIccTransform, bgra, (FX_LPCBYTE)&color, 1);
+ pIccModule->TranslateScanline(pIccTransform, bgra, (const uint8_t*)&color, 1);
bgra[3] = FXGETFLAG_COLORTYPE(alpha_flag) ?
(alpha_flag >> 24) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXGETFLAG_ALPHA_STROKE(alpha_flag) :
FXARGB_A(color);
@@ -294,7 +294,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
}
}
int dest_width = pixel_width;
- FX_LPBYTE dest_buf = bitmap.GetBuffer();
+ uint8_t* dest_buf = bitmap.GetBuffer();
int dest_pitch = bitmap.GetPitch();
int Bpp = bitmap.GetBPP() / 8;
int a, r, g, b;
@@ -326,7 +326,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
FX_BOOL bBGRStripe = text_flags & FXTEXT_BGR_STRIPE;
ncols /= 3;
int x_subpixel = (int)(glyph.m_fOriginX * 3) % 3;
- FX_LPBYTE src_buf = pGlyph->GetBuffer();
+ uint8_t* src_buf = pGlyph->GetBuffer();
int src_pitch = pGlyph->GetPitch();
int start_col = left;
if (start_col < 0) {
@@ -345,8 +345,8 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
if (dest_row < 0 || dest_row >= bitmap.GetHeight()) {
continue;
}
- FX_LPBYTE src_scan = src_buf + row * src_pitch + (start_col - left) * 3;
- FX_LPBYTE dest_scan = dest_buf + dest_row * dest_pitch + (start_col << 2);
+ uint8_t* src_scan = src_buf + row * src_pitch + (start_col - left) * 3;
+ uint8_t* dest_scan = dest_buf + dest_row * dest_pitch + (start_col << 2);
if (bBGRStripe) {
if (x_subpixel == 0) {
for (int col = start_col; col < end_col; col ++) {
@@ -658,8 +658,8 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
if (dest_row < 0 || dest_row >= bitmap.GetHeight()) {
continue;
}
- FX_LPBYTE src_scan = src_buf + row * src_pitch + (start_col - left) * 3;
- FX_LPBYTE dest_scan = dest_buf + dest_row * dest_pitch + start_col * Bpp;
+ uint8_t* src_scan = src_buf + row * src_pitch + (start_col - left) * 3;
+ uint8_t* dest_scan = dest_buf + dest_row * dest_pitch + start_col * Bpp;
if (bBGRStripe) {
if (x_subpixel == 0) {
for (int col = start_col; col < end_col; col ++) {
@@ -1052,10 +1052,10 @@ CFX_FaceCache::~CFX_FaceCache()
}
m_SizeMap.RemoveAll();
pos = m_PathMap.GetStartPosition();
- FX_LPVOID key1;
+ void* key1;
CFX_PathData* pPath;
while (pos) {
- m_PathMap.GetNextAssoc(pos, key1, (FX_LPVOID&)pPath);
+ m_PathMap.GetNextAssoc(pos, key1, (void*&)pPath);
delete pPath;
}
if (m_pBitmap) {
@@ -1081,14 +1081,14 @@ CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap(CFX_Font* pFont, const CFX_Aff
m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache);
}
CFX_GlyphBitmap* pGlyphBitmap = NULL;
- if (pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(uintptr_t)glyph_index, (void*&)pGlyphBitmap)) {
+ if (pSizeCache->m_GlyphMap.Lookup((void*)(uintptr_t)glyph_index, (void*&)pGlyphBitmap)) {
return pGlyphBitmap;
}
pGlyphBitmap = RenderGlyph(pFont, glyph_index, bFontStyle, pMatrix, dest_width, anti_alias);
if (pGlyphBitmap == NULL) {
return NULL;
}
- pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(uintptr_t)glyph_index, pGlyphBitmap);
+ pSizeCache->m_GlyphMap.SetAt((void*)(uintptr_t)glyph_index, pGlyphBitmap);
return pGlyphBitmap;
}
const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle, const CFX_AffineMatrix* pMatrix,
@@ -1135,12 +1135,12 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD
CFX_GlyphBitmap* pGlyphBitmap;
CFX_SizeGlyphCache* pSizeCache = NULL;
if (m_SizeMap.Lookup(FaceGlyphsKey, (void*&)pSizeCache)) {
- if (pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(uintptr_t)glyph_index, (void*&)pGlyphBitmap)) {
+ if (pSizeCache->m_GlyphMap.Lookup((void*)(uintptr_t)glyph_index, (void*&)pGlyphBitmap)) {
return pGlyphBitmap;
}
pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix, dest_width, anti_alias);
if (pGlyphBitmap) {
- pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(uintptr_t)glyph_index, pGlyphBitmap);
+ pSizeCache->m_GlyphMap.SetAt((void*)(uintptr_t)glyph_index, pGlyphBitmap);
return pGlyphBitmap;
}
} else {
@@ -1151,7 +1151,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD
return NULL;
}
m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache);
- pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(uintptr_t)glyph_index, pGlyphBitmap);
+ pSizeCache->m_GlyphMap.SetAt((void*)(uintptr_t)glyph_index, pGlyphBitmap);
return pGlyphBitmap;
}
}
@@ -1171,7 +1171,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD
CFX_SizeGlyphCache::~CFX_SizeGlyphCache()
{
FX_POSITION pos = m_GlyphMap.GetStartPosition();
- FX_LPVOID Key;
+ void* Key;
CFX_GlyphBitmap* pGlyphBitmap = NULL;
while(pos) {
m_GlyphMap.GetNextAssoc(pos, Key, (void*&)pGlyphBitmap);
@@ -1245,20 +1245,20 @@ static const uint8_t g_WeightPow_SHIFTJIS[WEIGHTPOW_ARRAY_SIZE] = {
55, 55, 55, 56, 56, 56, 56, 56 , 56, 57, 57, 57 , 57 , 57, 57, 57, 58, 58, 58, 58, 58,
58, 58, 59, 59, 59, 59, 59, 59, 59, 60, 60, 60, 60, 60, 60, 60, 60,
};
-static void _GammaAdjust(FX_LPBYTE pData, int nWid, int nHei, int src_pitch, FX_LPCBYTE gammaTable)
+static void _GammaAdjust(uint8_t* pData, int nWid, int nHei, int src_pitch, const uint8_t* gammaTable)
{
int count = nHei * src_pitch;
for(int i = 0; i < count; i++) {
pData[i] = gammaTable[pData[i]];
}
}
-static void _ContrastAdjust(FX_LPBYTE pDataIn, FX_LPBYTE pDataOut, int nWid, int nHei, int nSrcRowBytes, int nDstRowBytes)
+static void _ContrastAdjust(uint8_t* pDataIn, uint8_t* pDataOut, int nWid, int nHei, int nSrcRowBytes, int nDstRowBytes)
{
int col, row, temp;
int max = 0, min = 255;
FX_FLOAT rate;
for (row = 0; row < nHei; row ++) {
- FX_LPBYTE pRow = pDataIn + row * nSrcRowBytes;
+ uint8_t* pRow = pDataIn + row * nSrcRowBytes;
for (col = 0; col < nWid; col++) {
temp = *pRow ++;
if (temp > max) {
@@ -1279,8 +1279,8 @@ static void _ContrastAdjust(FX_LPBYTE pDataIn, FX_LPBYTE pDataOut, int nWid, int
}
rate = 255.f / temp;
for (row = 0; row < nHei; row ++) {
- FX_LPBYTE pSrcRow = pDataIn + row * nSrcRowBytes;
- FX_LPBYTE pDstRow = pDataOut + row * nDstRowBytes;
+ uint8_t* pSrcRow = pDataIn + row * nSrcRowBytes;
+ uint8_t* pDstRow = pDataOut + row * nDstRowBytes;
for (col = 0; col < nWid; col ++) {
temp = (int)((*(pSrcRow++) - min) * rate + 0.5);
if (temp > 255) {
@@ -1423,15 +1423,15 @@ FX_BOOL _OutputGlyph(void* dib, int x, int y, CFX_Font* pFont,
int bmheight = FXFT_Get_Bitmap_Rows(FXFT_Get_Glyph_Bitmap(face));
int left = FXFT_Get_Glyph_BitmapLeft(face);
int top = FXFT_Get_Glyph_BitmapTop(face);
- FX_LPCBYTE src_buf = (FX_LPCBYTE)FXFT_Get_Bitmap_Buffer(FXFT_Get_Glyph_Bitmap(face));
+ const uint8_t* src_buf = (const uint8_t*)FXFT_Get_Bitmap_Buffer(FXFT_Get_Glyph_Bitmap(face));
int src_pitch = FXFT_Get_Bitmap_Pitch(FXFT_Get_Glyph_Bitmap(face));
CFX_DIBitmap mask;
mask.Create(bmwidth, bmheight, FXDIB_8bppMask);
- FX_LPBYTE dest_buf = mask.GetBuffer();
+ uint8_t* dest_buf = mask.GetBuffer();
int dest_pitch = mask.GetPitch();
for (int row = 0; row < bmheight; row ++) {
- FX_LPCBYTE src_scan = src_buf + row * src_pitch;
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = src_buf + row * src_pitch;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
FXSYS_memcpy32(dest_scan, src_scan, dest_pitch);
}
pDib->CompositeMask(x + left, y - top, bmwidth, bmheight, &mask, argb, 0, 0);
@@ -1499,15 +1499,15 @@ const CFX_PathData* CFX_FaceCache::LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph
return NULL;
}
CFX_PathData* pGlyphPath = NULL;
- FX_LPVOID key;
+ void* key;
if (pFont->GetSubstFont())
- key = (FX_LPVOID)(uintptr_t)(glyph_index + ((pFont->GetSubstFont()->m_Weight / 16) << 15) +
+ key = (void*)(uintptr_t)(glyph_index + ((pFont->GetSubstFont()->m_Weight / 16) << 15) +
((pFont->GetSubstFont()->m_ItalicAngle / 2) << 21) + ((dest_width / 16) << 25) +
(pFont->IsVertical() << 31));
else {
- key = (FX_LPVOID)(uintptr_t)glyph_index;
+ key = (void*)(uintptr_t)glyph_index;
}
- if (m_PathMap.Lookup(key, (FX_LPVOID&)pGlyphPath)) {
+ if (m_PathMap.Lookup(key, (void*&)pGlyphPath)) {
return pGlyphPath;
}
pGlyphPath = pFont->LoadGlyphPath(glyph_index, dest_width);
diff --git a/core/src/fxge/ge/text_int.h b/core/src/fxge/ge/text_int.h
index 39f6cb8567..bcc2b05042 100644
--- a/core/src/fxge/ge/text_int.h
+++ b/core/src/fxge/ge/text_int.h
@@ -106,7 +106,7 @@ class CFX_FontEncodingEX : public IFX_FontEncodingEx
public:
CFX_FontEncodingEX();
FX_BOOL Init(CFX_Font* pFont, FX_DWORD EncodingID);
- virtual FX_DWORD GlyphIndexFromName(FX_LPCSTR pStrName);
+ virtual FX_DWORD GlyphIndexFromName(const FX_CHAR* pStrName);
virtual CFX_ByteString NameFromGlyphIndex(FX_DWORD dwGlyphIndex);
virtual FX_DWORD CharCodeFromGlyphIndex(FX_DWORD dwGlyphIndex);
virtual FX_DWORD GlyphFromCharCode(FX_DWORD charcode);