- Move GetCharacterPlacement functions into new locations. Implemented GetCharacterPlacementA from wine port.

- Port from wine, original authors: Juergen Schmied <juergen.schmied@metronet.de>, Peter Oberndorfer <kumbayo84@arcor.de>

svn path=/trunk/; revision=42751
This commit is contained in:
James Tabor 2009-08-17 01:34:20 +00:00
parent 2e771a7968
commit 2594a8fbef
4 changed files with 110 additions and 39 deletions

View file

@ -13,28 +13,6 @@
#define UNIMPLEMENTED DbgPrint("GDI32: %s is unimplemented, please try again later.\n", __FUNCTION__);
/*
* @unimplemented
*/
DWORD
WINAPI
GetCharacterPlacementA(
HDC hDc,
LPCSTR a1,
int a2,
int a3,
LPGCP_RESULTSA a4,
DWORD a5
)
{
UNIMPLEMENTED;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
/*
* @unimplemented
*/

View file

@ -425,6 +425,58 @@ EnumFontFamiliesA(HDC hdc, LPCSTR lpszFamily, FONTENUMPROCA lpEnumFontFamProc,
return IntEnumFontFamilies(hdc, &LogFont, lpEnumFontFamProc, lParam, FALSE);
}
/*
* @implemented
*/
DWORD
WINAPI
GetCharacterPlacementA(
HDC hdc,
LPCSTR lpString,
INT uCount,
INT nMaxExtent,
GCP_RESULTSA *lpResults,
DWORD dwFlags)
{
WCHAR *lpStringW;
INT uCountW;
GCP_RESULTSW resultsW;
DWORD ret;
UINT font_cp;
if ( !lpString || uCount <= 0 || (nMaxExtent < 0 && nMaxExtent != -1 ) )
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
/* TRACE("%s, %d, %d, 0x%08x\n",
debugstr_an(lpString, uCount), uCount, nMaxExtent, dwFlags);
*/
/* both structs are equal in size */
memcpy(&resultsW, lpResults, sizeof(resultsW));
lpStringW = FONT_mbtowc(hdc, lpString, uCount, &uCountW, &font_cp);
if(lpResults->lpOutString)
resultsW.lpOutString = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*uCountW);
ret = GetCharacterPlacementW(hdc, lpStringW, uCountW, nMaxExtent, &resultsW, dwFlags);
lpResults->nGlyphs = resultsW.nGlyphs;
lpResults->nMaxFit = resultsW.nMaxFit;
if(lpResults->lpOutString) {
WideCharToMultiByte(font_cp, 0, resultsW.lpOutString, uCountW,
lpResults->lpOutString, uCount, NULL, NULL );
}
HeapFree(GetProcessHeap(), 0, lpStringW);
HeapFree(GetProcessHeap(), 0, resultsW.lpOutString);
return ret;
}
/*
* @implemented
*/
@ -507,6 +559,47 @@ GetCharacterPlacementW(
return ret;
}
DWORD
WINAPI
NewGetCharacterPlacementW(
HDC hdc,
LPCWSTR lpString,
INT uCount,
INT nMaxExtent,
GCP_RESULTSW *lpResults,
DWORD dwFlags
)
{
INT nSet;
SIZE Size = {0,0};
if ( !lpString || uCount <= 0 || (nMaxExtent < 0 && nMaxExtent != -1 ) )
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
if ( !lpResults )
{
if ( GetTextExtentPointW(hdc, lpString, uCount, &Size) )
{
return MAKELONG(Size.cx, Size.cy);
}
return 0;
}
nSet = uCount;
if ( nSet > lpResults->nGlyphs )
nSet = lpResults->nGlyphs;
return NtGdiGetCharacterPlacementW( hdc,
(LPWSTR)lpString,
nSet,
nMaxExtent,
lpResults,
dwFlags);
}
/*
* @implemented
*

View file

@ -217,6 +217,23 @@ NtGdiAddFontResourceW(
return Ret;
}
/*
* @unimplemented
*/
DWORD
APIENTRY
NtGdiGetCharacterPlacementW(
IN HDC hdc,
IN LPWSTR pwsz,
IN INT nCount,
IN INT nMaxExtent,
IN OUT LPGCP_RESULTSW pgcpw,
IN DWORD dwFlags)
{
UNIMPLEMENTED;
return 0;
}
DWORD
APIENTRY
NtGdiGetFontData(

View file

@ -1161,23 +1161,6 @@ NtGdiFullscreenControl(
return FALSE;
}
/*
* @unimplemented
*/
DWORD
APIENTRY
NtGdiGetCharacterPlacementW(
IN HDC hdc,
IN LPWSTR pwsz,
IN INT nCount,
IN INT nMaxExtent,
IN OUT LPGCP_RESULTSW pgcpw,
IN DWORD dwFlags)
{
UNIMPLEMENTED;
return 0;
}
/*
* @unimplemented
*/