Module: wine Branch: refs/heads/master Commit: 401e32ee38f70414bda9c4a8c47720e259ea5be5 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=401e32ee38f70414bda9c4a8...
Author: Hans Leidekker hans@it.vu.nl Date: Wed Jul 19 21:45:24 2006 +0200
usp10: Implement and test ScriptCacheGetHeight.
---
dlls/usp10/usp10.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ dlls/usp10/usp10.spec | 2 +- 2 files changed, 46 insertions(+), 1 deletions(-)
diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index abd9c89..aa39449 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -652,3 +652,48 @@ HRESULT WINAPI ScriptTextOut(const HDC h return hr; } } + +/*********************************************************************** + * ScriptCacheGetHeight (USP10.@) + * + * Retrieve the height of the font in the cache. + * + * PARAMS + * hdc [I] Device context. + * psc [I/O] Opaque pointer to a script cache. + * height [O] Receives font height. + * + * RETURNS + * Success: S_OK + * Failure: Non-zero HRESULT value. + */ +HRESULT WINAPI ScriptCacheGetHeight(HDC hdc, SCRIPT_CACHE *psc, long *height) +{ + HDC phdc; + Scriptcache *pScriptcache; + TEXTMETRICW metric; + + TRACE("(%p, %p, %p)\n", hdc, psc, height); + + if (!psc || !height) + return E_INVALIDARG; + + if (!hdc) return E_PENDING; + + if (!*psc) { + pScriptcache = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(Scriptcache)); + pScriptcache->hdc = hdc; + phdc = hdc; + *psc = pScriptcache; + } else { + pScriptcache = *psc; + phdc = pScriptcache->hdc; + } + + /* FIXME: get this from the cache */ + if (!GetTextMetricsW(phdc, &metric)) + return E_INVALIDARG; + + *height = metric.tmHeight; + return S_OK; +} diff --git a/dlls/usp10/usp10.spec b/dlls/usp10/usp10.spec index c4e47fc..3d0e1ce 100644 --- a/dlls/usp10/usp10.spec +++ b/dlls/usp10/usp10.spec @@ -3,7 +3,7 @@ @ stub ScriptApplyLogicalWidth @ stdcall ScriptBreak(ptr long ptr ptr) @ stdcall ScriptCPtoX(long long long long ptr ptr ptr ptr ptr) -@ stub ScriptCacheGetHeight +@ stdcall ScriptCacheGetHeight(ptr ptr ptr) @ stdcall ScriptFreeCache(ptr) @ stdcall ScriptGetCMap(ptr ptr ptr long long ptr) @ stdcall ScriptGetFontProperties(long ptr ptr)