From 5f529fe0d87f35f75e32785e9b0d8c490117c830 Mon Sep 17 00:00:00 2001 From: Jeff Latimer Date: Wed, 7 Jun 2006 23:05:14 +1000 Subject: [PATCH] usp10: Add stubs for ScriptCPtoX, ScriptXtoCP and ScriptBreak and some basic tests. --- dlls/usp10/tests/usp10.c | 14 +++++++++ dlls/usp10/usp10.c | 62 ++++++++++++++++++++++++++++++++++++++-- dlls/usp10/usp10.spec | 6 ++-- 3 files changed, 77 insertions(+), 5 deletions(-) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 15d4c40cbcd..95203edb4d7 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -352,6 +352,11 @@ void test_ScriptTextOut(void) GOFFSET pGoffset[256]; ABC pABC[256]; RECT rect; + int piX; + int iCP = 1; + BOOL fTrailing = FALSE; + SCRIPT_LOGATTR *psla; + SCRIPT_LOGATTR sla[256]; /* We need a valid HDC to drive a lot of Script functions which requires the following * * to set up for the tests. */ @@ -438,6 +443,15 @@ void test_ScriptTextOut(void) ok (hr == 0, "ScriptTextOut should return 0 not (%08x)\n", (unsigned int) hr); ok (psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n"); + iCP = 1; + hr = ScriptCPtoX(iCP, fTrailing, cChars, pcGlyphs, (const WORD *) &pwLogClust, + (const SCRIPT_VISATTR *) &psva, (const int *)&piAdvance, &pItem[0].a, &piX); + ok(hr == S_OK, "ScriptCPtoX Stub should return S_OK not %08x\n", (unsigned int) hr); + + psla = (SCRIPT_LOGATTR *)&sla; + hr = ScriptBreak(TestItem1, cChars, &pItem[0].a, psla); + ok(hr == S_OK, "ScriptBreak Stub should return S_OK not %08x\n", (unsigned int) hr); + /* Clean up and go */ ScriptFreeCache(&psc); ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc); diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index f24a7f0259a..abd4952afd5 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -321,8 +321,66 @@ HRESULT WINAPI ScriptStringOut(SCRIPT_STRING_ANALYSIS ssa, * */ HRESULT WINAPI ScriptStringFree(SCRIPT_STRING_ANALYSIS *pssa) { - FIXME("(%p): stub\n",pssa); - return S_OK; + FIXME("(%p): stub\n",pssa); + return S_OK; +} + +/*********************************************************************** + * ScriptCPtoX (USP10.@) + * + */ +HRESULT WINAPI ScriptCPtoX(int iCP, + BOOL fTrailing, + int cChars, + int cGlyphs, + const WORD *pwLogClust, + const SCRIPT_VISATTR *psva, + const int *piAdvance, + const SCRIPT_ANALYSIS *psa, + int *piX) +{ + FIXME("(%d,%d,%d,%d,%p,%p,%p,%p,%p): stub\n", + iCP, fTrailing, cChars, cGlyphs, pwLogClust, psva, piAdvance, + psa, piX); + + *piX = 1; /* Return something in range */ + return S_OK; +} + +/*********************************************************************** + * ScriptXtoCP (USP10.@) + * + */ +HRESULT WINAPI ScriptXtoCP(int iX, + int cChars, + int cGlyphs, + const WORD *pwLogClust, + const SCRIPT_VISATTR *psva, + const int *piAdvance, + const SCRIPT_ANALYSIS *psa, + int *piCP, + int *piTrailing) +{ + FIXME("(%d,%d,%d,%p,%p,%p,%p,%p,%p): stub\n", + iX, cChars, cGlyphs, pwLogClust, psva, piAdvance, + psa, piCP, piTrailing); + + *piCP = 1; /* Return something in range */ + *piTrailing = 0; + return S_OK; +} + +/*********************************************************************** + * ScriptBreak (USP10.@) + * + */ +HRESULT WINAPI ScriptBreak(const WCHAR *pwcChars, int cChars, const SCRIPT_ANALYSIS *psa, + SCRIPT_LOGATTR *psla) +{ + FIXME("(%p,%d,%p,%p): stub\n", + pwcChars, cChars, psa, psla); + + return S_OK; } /*********************************************************************** diff --git a/dlls/usp10/usp10.spec b/dlls/usp10/usp10.spec index 518a04e61d4..22ee6889d27 100644 --- a/dlls/usp10/usp10.spec +++ b/dlls/usp10/usp10.spec @@ -1,8 +1,8 @@ @ stub LpkPresent @ stdcall ScriptApplyDigitSubstitution(ptr ptr ptr) @ stub ScriptApplyLogicalWidth -@ stub ScriptBreak -@ stub ScriptCPtoX +@ stdcall ScriptBreak(ptr long ptr ptr) +@ stdcall ScriptCPtoX(long long long long ptr ptr ptr ptr ptr) @ stub ScriptCacheGetHeight @ stdcall ScriptFreeCache(ptr) @ stdcall ScriptGetCMap(ptr ptr ptr long long ptr) @@ -29,7 +29,7 @@ @ stub ScriptString_pSize @ stub ScriptString_pcOutChars @ stdcall ScriptTextOut(ptr ptr long long long ptr ptr ptr long ptr long ptr ptr ptr) -@ stub ScriptXtoCP +@ stdcall ScriptXtoCP(long long long ptr ptr ptr ptr ptr ptr) @ stub UspAllocCache @ stub UspAllocTemp @ stub UspFreeMem