Jeff Latimer : usp10: Add stubs for ScriptCPtoX, ScriptXtoCP and ScriptBreak and some basic tests.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jun 8 05:06:18 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 5f529fe0d87f35f75e32785e9b0d8c490117c830
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=5f529fe0d87f35f75e32785e9b0d8c490117c830

Author: Jeff Latimer <lats at yless4u.com.au>
Date:   Wed Jun  7 23:05:14 2006 +1000

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 15d4c40..95203ed 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 f24a7f0..abd4952 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -321,8 +321,66 @@ HRESULT WINAPI ScriptStringOut(SCRIPT_ST
  *
  */
 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 518a04e..22ee688 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




More information about the wine-cvs mailing list