summaryrefslogtreecommitdiff
path: root/core/src/fxge/win32
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-10 14:33:37 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-10 14:33:37 -0700
commitd7e5cc754a937605d1f73db5e7967c58ddd80742 (patch)
treeed28e012c4d6a46b7f29f15a0c060474c27d4286 /core/src/fxge/win32
parentbfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (diff)
downloadpdfium-d7e5cc754a937605d1f73db5e7967c58ddd80742.tar.xz
Merge to XFA: Remove typdefs for pointer types in fx_system.h.
Original Review URL: https://codereview.chromium.org/1171733003 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1178613002.
Diffstat (limited to 'core/src/fxge/win32')
-rw-r--r--core/src/fxge/win32/dwrite_int.h2
-rw-r--r--core/src/fxge/win32/fx_win32_device.cpp36
-rw-r--r--core/src/fxge/win32/fx_win32_dib.cpp6
-rw-r--r--core/src/fxge/win32/fx_win32_dwrite.cpp4
-rw-r--r--core/src/fxge/win32/fx_win32_gdipext.cpp6
-rw-r--r--core/src/fxge/win32/fx_win32_print.cpp14
-rw-r--r--core/src/fxge/win32/win32_int.h18
7 files changed, 43 insertions, 43 deletions
diff --git a/core/src/fxge/win32/dwrite_int.h b/core/src/fxge/win32/dwrite_int.h
index d95f115fbc..4192fb74ae 100644
--- a/core/src/fxge/win32/dwrite_int.h
+++ b/core/src/fxge/win32/dwrite_int.h
@@ -40,7 +40,7 @@ public:
return m_pDWriteFactory != NULL;
}
- void* DwCreateFontFaceFromStream(FX_LPBYTE pData, FX_DWORD size, int simulation_style);
+ void* DwCreateFontFaceFromStream(uint8_t* pData, FX_DWORD size, int simulation_style);
FX_BOOL DwCreateRenderingTarget(CFX_DIBitmap* pSrc, void** renderTarget);
void DwDeleteRenderingTarget(void* renderTarget);
FX_BOOL DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix,
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index 7ebdcb380e..5fb9036381 100644
--- a/core/src/fxge/win32/fx_win32_device.cpp
+++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -23,12 +23,12 @@ public:
~CWin32FontInfo();
virtual void Release();
virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper);
- virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR face, FX_BOOL& bExact);
- virtual void* GetFont(FX_LPCSTR face)
+ virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* face, FX_BOOL& bExact);
+ virtual void* GetFont(const FX_CHAR* face)
{
return NULL;
}
- virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size);
+ virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer, FX_DWORD size);
virtual void DeleteFont(void* hFont);
virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name);
virtual FX_BOOL GetFontCharset(void* hFont, int& charset);
@@ -152,15 +152,15 @@ FX_BOOL CWin32FontInfo::EnumFontList(CFX_FontMapper* pMapper)
return TRUE;
}
static const struct {
- FX_LPCSTR m_pFaceName;
- FX_LPCSTR m_pVariantName;
+ const FX_CHAR* m_pFaceName;
+ const FX_CHAR* m_pVariantName;
}
VariantNames[] = {
{"DFKai-SB", "\x19\x6A\x77\x69\xD4\x9A"},
};
static const struct {
- FX_LPCSTR m_pName;
- FX_LPCSTR m_pWinName;
+ const FX_CHAR* m_pName;
+ const FX_CHAR* m_pWinName;
FX_BOOL m_bBold;
FX_BOOL m_bItalic;
}
@@ -197,8 +197,8 @@ CFX_ByteString CWin32FontInfo::FindFont(const CFX_ByteString& name)
return CFX_ByteString();
}
struct _FontNameMap {
- FX_LPCSTR m_pSubFontName;
- FX_LPCSTR m_pSrcFontName;
+ const FX_CHAR* m_pSubFontName;
+ const FX_CHAR* m_pSrcFontName;
};
const _FontNameMap g_JpFontNameMap[] = {
{"MS Mincho", "Heiseimin-W3"},
@@ -207,7 +207,7 @@ const _FontNameMap g_JpFontNameMap[] = {
extern "C" {
static int compareString(const void* key, const void* element)
{
- return FXSYS_stricmp((FX_LPCSTR)key, ((_FontNameMap*)element)->m_pSrcFontName);
+ return FXSYS_stricmp((const FX_CHAR*)key, ((_FontNameMap*)element)->m_pSrcFontName);
}
}
FX_BOOL _GetSubFontName(CFX_ByteString& name)
@@ -282,7 +282,7 @@ void CWin32FontInfo::GetJapanesePreference(CFX_ByteString& face, int weight, int
face = "MS PMincho";
}
}
-void* CWin32FontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR cstr_face, FX_BOOL& bExact)
+void* CWin32FontInfo::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;
@@ -359,7 +359,7 @@ void CWin32FontInfo::DeleteFont(void* hFont)
{
::DeleteObject(hFont);
}
-FX_DWORD CWin32FontInfo::GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size)
+FX_DWORD CWin32FontInfo::GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer, FX_DWORD size)
{
HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont);
table = FXDWORD_FROM_MSBFIRST(table);
@@ -459,14 +459,14 @@ int CGdiDeviceDriver::GetDeviceCaps(int caps_id)
}
return 0;
}
-FX_LPVOID CGdiDeviceDriver::GetClipRgn()
+void* CGdiDeviceDriver::GetClipRgn()
{
HRGN hClipRgn = CreateRectRgn(0, 0, 1, 1);
if (::GetClipRgn(m_hDC, hClipRgn) == 0) {
DeleteObject(hClipRgn);
hClipRgn = NULL;
}
- return (FX_LPVOID)hClipRgn;
+ return (void*)hClipRgn;
}
FX_BOOL CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_RECT* pSrcRect, int left, int top, void* pIccTransform)
{
@@ -600,7 +600,7 @@ BOOL CGdiDeviceDriver::GetClipBox(FX_RECT* pRect)
{
return ::GetClipBox(m_hDC, (RECT*)pRect);
}
-FX_BOOL CGdiDeviceDriver::SetClipRgn(FX_LPVOID hRgn)
+FX_BOOL CGdiDeviceDriver::SetClipRgn(void* hRgn)
{
::SelectClipRgn(m_hDC, (HRGN)hRgn);
return TRUE;
@@ -930,7 +930,7 @@ FX_BOOL CGdiDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2
DeleteObject(hPen);
return TRUE;
}
-FX_BOOL CGdiDeviceDriver::DeleteDeviceRgn(FX_LPVOID pRgn)
+FX_BOOL CGdiDeviceDriver::DeleteDeviceRgn(void* pRgn)
{
DeleteObject((HGDIOBJ)pRgn);
return TRUE;
@@ -1182,8 +1182,8 @@ CFX_WinBitmapDevice::CFX_WinBitmapDevice(int width, int height, FXDIB_Format for
bmih.biHeight = -height;
bmih.biPlanes = 1;
bmih.biWidth = width;
- FX_LPBYTE pBuffer;
- m_hBitmap = CreateDIBSection(NULL, (BITMAPINFO*)&bmih, DIB_RGB_COLORS, (FX_LPVOID*)&pBuffer, NULL, 0);
+ uint8_t* pBuffer;
+ m_hBitmap = CreateDIBSection(NULL, (BITMAPINFO*)&bmih, DIB_RGB_COLORS, (void**)&pBuffer, NULL, 0);
if (m_hBitmap == NULL) {
return;
}
diff --git a/core/src/fxge/win32/fx_win32_dib.cpp b/core/src/fxge/win32/fx_win32_dib.cpp
index 7706ee289e..a3ec5cd6f0 100644
--- a/core/src/fxge/win32/fx_win32_dib.cpp
+++ b/core/src/fxge/win32/fx_win32_dib.cpp
@@ -71,7 +71,7 @@ CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_BOOL
}
FXSYS_memcpy32(pBitmap->GetBuffer(), pData, pitch * height);
if (bBottomUp) {
- FX_LPBYTE temp_buf = FX_Alloc(uint8_t, pitch);
+ uint8_t* temp_buf = FX_Alloc(uint8_t, pitch);
int top = 0, bottom = height - 1;
while (top < bottom) {
FXSYS_memcpy32(temp_buf, pBitmap->GetBuffer() + top * pitch, pitch);
@@ -113,7 +113,7 @@ void GetBitmapSize(HBITMAP hBitmap, int& w, int& h)
w = bmp.bmWidth;
h = bmp.bmHeight;
}
-CFX_DIBitmap* CFX_WindowsDIB::LoadFromFile(FX_LPCWSTR filename)
+CFX_DIBitmap* CFX_WindowsDIB::LoadFromFile(const FX_WCHAR* filename)
{
CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
if (pPlatform->m_GdiplusExt.IsAvailable()) {
@@ -267,7 +267,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC, HBITMAP hBitmap, FX_DWORD* pP
}
CFX_WindowsDIB::CFX_WindowsDIB(HDC hDC, int width, int height)
{
- Create(width, height, FXDIB_Rgb, (FX_LPBYTE)1);
+ Create(width, height, FXDIB_Rgb, (uint8_t*)1);
BITMAPINFOHEADER bmih;
FXSYS_memset32(&bmih, 0, sizeof bmih);
bmih.biSize = sizeof bmih;
diff --git a/core/src/fxge/win32/fx_win32_dwrite.cpp b/core/src/fxge/win32/fx_win32_dwrite.cpp
index 2a490a62a4..ffecc0de72 100644
--- a/core/src/fxge/win32/fx_win32_dwrite.cpp
+++ b/core/src/fxge/win32/fx_win32_dwrite.cpp
@@ -129,7 +129,7 @@ CDWriteExt::~CDWriteExt()
{
Unload();
}
-LPVOID CDWriteExt::DwCreateFontFaceFromStream(FX_LPBYTE pData, FX_DWORD size, int simulation_style)
+LPVOID CDWriteExt::DwCreateFontFaceFromStream(uint8_t* pData, FX_DWORD size, int simulation_style)
{
IDWriteFactory* pDwFactory = (IDWriteFactory*)m_pDWriteFactory;
IDWriteFontFile* pDwFontFile = NULL;
@@ -440,7 +440,7 @@ STDMETHODIMP CDwGdiTextRenderer::DrawGlyphRun(
bitmap.bmWidth,
bitmap.bmHeight,
bitmap.bmBitsPixel == 24 ? FXDIB_Rgb : FXDIB_Rgb32,
- (FX_LPBYTE)bitmap.bmBits
+ (uint8_t*)bitmap.bmBits
);
dib.CompositeBitmap(
text_bbox.left,
diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp
index fd31d2da66..68a27ab38f 100644
--- a/core/src/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/src/fxge/win32/fx_win32_gdipext.cpp
@@ -352,7 +352,7 @@ static void OutputImageMask(GpGraphics* pGraphics, BOOL bMonoDevice, const CFX_D
CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
int src_width = pBitmap->GetWidth(), src_height = pBitmap->GetHeight();
int src_pitch = pBitmap->GetPitch();
- FX_LPBYTE scan0 = pBitmap->GetBuffer();
+ uint8_t* scan0 = pBitmap->GetBuffer();
if (src_width == 1 && src_height == 1) {
if ((scan0[0] & 0x80) == 0) {
return;
@@ -433,7 +433,7 @@ static void OutputImage(GpGraphics* pGraphics, const CFX_DIBitmap* pBitmap, cons
return;
}
int src_pitch = pBitmap->GetPitch();
- FX_LPBYTE scan0 = pBitmap->GetBuffer() + pSrcRect->top * src_pitch + pBitmap->GetBPP() * pSrcRect->left / 8;
+ uint8_t* scan0 = pBitmap->GetBuffer() + pSrcRect->top * src_pitch + pBitmap->GetBPP() * pSrcRect->left / 8;
GpBitmap* bitmap = NULL;
switch (pBitmap->GetFormat()) {
case FXDIB_Argb:
@@ -572,7 +572,7 @@ FX_BOOL CGdiplusExt::GdipCreateFromImage(void* bitmap, void** graphics)
}
return FALSE;
}
-FX_BOOL CGdiplusExt::GdipCreateFontFamilyFromName(FX_LPCWSTR name, void* pFontCollection, void**pFamily)
+FX_BOOL CGdiplusExt::GdipCreateFontFamilyFromName(const FX_WCHAR* name, void* pFontCollection, void**pFamily)
{
CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
GpStatus status = CallFunc(GdipCreateFontFamilyFromName)((GDIPCONST WCHAR *)name, (GpFontCollection*)pFontCollection, (GpFontFamily**)pFamily);
diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp
index 4ebeab9023..4600d186a6 100644
--- a/core/src/fxge/win32/fx_win32_print.cpp
+++ b/core/src/fxge/win32/fx_win32_print.cpp
@@ -121,7 +121,7 @@ static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, const CFX_Af
return NULL;
}
int src_width = pSrcBitmap->GetWidth(), src_height = pSrcBitmap->GetHeight();
- FX_LPBYTE src_buf = pSrcBitmap->GetBuffer();
+ uint8_t* src_buf = pSrcBitmap->GetBuffer();
FX_DWORD src_pitch = pSrcBitmap->GetPitch();
FX_FLOAT dest_area = pDestMatrix->GetUnitArea();
FX_FLOAT area_scale = FXSYS_Div((FX_FLOAT)(src_width * src_height), dest_area);
@@ -158,12 +158,12 @@ static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, const CFX_Af
return NULL;
}
pTempBitmap->CopyPalette(pSrc->GetPalette());
- FX_LPBYTE dest_buf = pTempBitmap->GetBuffer();
+ uint8_t* dest_buf = pTempBitmap->GetBuffer();
int dest_pitch = pTempBitmap->GetPitch();
FXSYS_memset8(dest_buf, pSrc->IsAlphaMask() ? 0 : 0xff, dest_pitch * result_height);
if (pSrcBitmap->IsAlphaMask()) {
for (int dest_y = 0; dest_y < result_height; dest_y ++) {
- FX_LPBYTE dest_scan = dest_buf + dest_y * dest_pitch;
+ uint8_t* dest_scan = dest_buf + dest_y * dest_pitch;
for (int dest_x = 0; dest_x < result_width; dest_x ++) {
int src_x, src_y;
result2src_fix.Transform(dest_x, dest_y, src_x, src_y);
@@ -178,7 +178,7 @@ static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, const CFX_Af
}
} else {
for (int dest_y = 0; dest_y < result_height; dest_y ++) {
- FX_LPBYTE dest_scan = dest_buf + dest_y * dest_pitch;
+ uint8_t* dest_scan = dest_buf + dest_y * dest_pitch;
for (int dest_x = 0; dest_x < result_width; dest_x ++) {
int src_x, src_y;
result2src_fix.Transform(dest_x, dest_y, src_x, src_y);
@@ -198,7 +198,7 @@ static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, const CFX_Af
return pTempBitmap;
}
FX_BOOL CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, FX_LPVOID& handle,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_type)
{
if (bitmap_alpha < 255 || pSource->HasAlpha() || (pSource->IsAlphaMask() && (pSource->GetBPP() != 1 || !m_bSupportROP))) {
@@ -256,7 +256,7 @@ void CPSOutput::Init()
{
m_pBuf = FX_Alloc(FX_CHAR, 1026);
}
-void CPSOutput::OutputPS(FX_LPCSTR string, int len)
+void CPSOutput::OutputPS(const FX_CHAR* string, int len)
{
if (len < 0) {
len = (int)FXSYS_strlen(string);
@@ -402,7 +402,7 @@ FX_BOOL CPSPrinterDriver::StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD c
return m_PSRenderer.StretchDIBits(pBitmap, color, dest_left, dest_top, dest_width, dest_height, flags, alpha_flag, pIccTransform);
}
FX_BOOL CPSPrinterDriver::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, FX_LPVOID& handle,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_type)
{
if (blend_type != FXDIB_BLEND_NORMAL) {
diff --git a/core/src/fxge/win32/win32_int.h b/core/src/fxge/win32/win32_int.h
index a3380f3b5b..1f8f5d7995 100644
--- a/core/src/fxge/win32/win32_int.h
+++ b/core/src/fxge/win32/win32_int.h
@@ -41,7 +41,7 @@ public:
void GdipDeleteBrush(void* pBrush);
void GdipCreateMatrix(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, void** matrix);
void GdipDeleteMatrix(void* matrix);
- FX_BOOL GdipCreateFontFamilyFromName(FX_LPCWSTR name, void* pFontCollection, void**pFamily);
+ FX_BOOL GdipCreateFontFamilyFromName(const FX_WCHAR* name, void* pFontCollection, void**pFamily);
void GdipDeleteFontFamily(void* pFamily);
FX_BOOL GdipCreateFontFromFamily(void* pFamily, FX_FLOAT font_size, int fontstyle, int flag, void** pFont);
void* GdipCreateFontFromCollection(void* pFontCollection, FX_FLOAT font_size, int fontstyle);
@@ -105,10 +105,10 @@ protected:
int alpha_flag, void* pIccTransform, int blend_type);
virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
int alpha_flag, void* pIccTransform, int blend_type);
- virtual FX_LPVOID GetClipRgn() ;
- virtual FX_BOOL SetClipRgn(FX_LPVOID pRgn) ;
+ virtual void* GetClipRgn() ;
+ virtual FX_BOOL SetClipRgn(void* pRgn) ;
virtual FX_BOOL GetClipBox(FX_RECT* pRect);
- virtual FX_BOOL DeleteDeviceRgn(FX_LPVOID pRgn);
+ virtual FX_BOOL DeleteDeviceRgn(void* pRgn);
virtual void DrawLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2);
virtual void* GetPlatformSurface()
{
@@ -140,7 +140,7 @@ protected:
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag, void* pIccTransform, int blend_type);
virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, FX_LPVOID& handle,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_type)
{
return FALSE;
@@ -161,7 +161,7 @@ protected:
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag, void* pIccTransform, int blend_type);
virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, FX_LPVOID& handle,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_type);
int m_HorzSize, m_VertSize;
FX_BOOL m_bSupportROP;
@@ -176,9 +176,9 @@ public:
delete this;
}
void Init();
- virtual void OutputPS(FX_LPCSTR string, int len);
+ virtual void OutputPS(const FX_CHAR* string, int len);
HDC m_hDC;
- FX_LPSTR m_pBuf;
+ FX_CHAR* m_pBuf;
};
class CPSPrinterDriver : public IFX_RenderDeviceDriver
{
@@ -221,7 +221,7 @@ protected:
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag, void* pIccTransform, int blend_type);
virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, FX_LPVOID& handle,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_type);
virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,