Author: akhaldi
Date: Sat Jul 2 13:14:52 2016
New Revision: 71739
URL:
http://svn.reactos.org/svn/reactos?rev=71739&view=rev
Log:
[T2EMBED] Sync with Wine Staging 1.9.11. CORE-11368
Modified:
trunk/reactos/dll/win32/t2embed/main.c
trunk/reactos/dll/win32/t2embed/stubs.c
trunk/reactos/dll/win32/t2embed/t2embed.spec
trunk/reactos/media/doc/README.WINE
trunk/reactos/sdk/include/psdk/t2embapi.h
Modified: trunk/reactos/dll/win32/t2embed/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/t2embed/main.c?r…
==============================================================================
--- trunk/reactos/dll/win32/t2embed/main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/t2embed/main.c [iso-8859-1] Sat Jul 2 13:14:52 2016
@@ -19,9 +19,13 @@
#define WIN32_NO_STATUS
#include <stdarg.h>
+
#include <windef.h>
#include <winbase.h>
+#include <wingdi.h>
+#include <winreg.h>
#include <t2embapi.h>
+
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(t2embed);
@@ -70,16 +74,100 @@
LONG WINAPI TTGetEmbeddingType(HDC hDC, ULONG *status)
{
- FIXME("(%p %p) stub\n", hDC, status);
- if (status) *status = EMBED_NOEMBEDDING;
- return E_API_NOTIMPL;
+ OUTLINETEXTMETRICW otm;
+
+ TRACE("(%p %p)\n", hDC, status);
+
+ if (!hDC)
+ return E_HDCINVALID;
+
+ otm.otmSize = sizeof(otm);
+ if (!GetOutlineTextMetricsW(hDC, otm.otmSize, &otm))
+ return E_NOTATRUETYPEFONT;
+
+ if (!status)
+ return E_PERMISSIONSINVALID;
+
+ if (otm.otmfsType == LICENSE_INSTALLABLE)
+ *status = EMBED_INSTALLABLE;
+ else if (otm.otmfsType & LICENSE_NOEMBEDDING)
+ *status = EMBED_NOEMBEDDING;
+ else if (otm.otmfsType & LICENSE_PREVIEWPRINT)
+ *status = EMBED_PREVIEWPRINT;
+ else if (otm.otmfsType & LICENSE_EDITABLE)
+ *status = EMBED_EDITABLE;
+
+ return E_NONE;
+}
+
+LONG WINAPI TTIsEmbeddingEnabledForFacename(LPCSTR facename, BOOL *enabled)
+{
+ static const WCHAR exclusionlistW[] =
{'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
+ 'S','h','a','r','e','d','
','T','o','o','l','s','\\','t','2','e','m','b','e','d',0};
+ DWORD index;
+ HKEY hkey;
+ LONG ret;
+
+ TRACE("(%s %p)\n", debugstr_a(facename), enabled);
+
+ if (!facename)
+ return E_FACENAMEINVALID;
+
+ if (!enabled)
+ return E_PBENABLEDINVALID;
+
+ *enabled = TRUE;
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, exclusionlistW, 0, GENERIC_READ, &hkey))
+ return E_NONE;
+
+ *enabled = TRUE;
+ ret = ERROR_SUCCESS;
+ index = 0;
+ while (ret != ERROR_NO_MORE_ITEMS)
+ {
+ DWORD name_len, value_len, value, type;
+ CHAR name[LF_FACESIZE];
+
+ name_len = sizeof(name)/sizeof(*name);
+ value_len = sizeof(value);
+ ret = RegEnumValueA(hkey, index++, name, &name_len, NULL, &type,
(BYTE*)&value, &value_len);
+ if (ret || type != REG_DWORD)
+ continue;
+
+ if (!lstrcmpiA(name, facename))
+ {
+ *enabled = !!value;
+ break;
+ }
+ }
+ RegCloseKey(hkey);
+
+ return E_NONE;
}
LONG WINAPI TTIsEmbeddingEnabled(HDC hDC, BOOL *enabled)
{
- FIXME("(%p %p) stub\n", hDC, enabled);
- if (enabled) *enabled = FALSE;
- return E_API_NOTIMPL;
+ OUTLINETEXTMETRICA *otm;
+ LONG ret;
+ UINT len;
+
+ TRACE("(%p %p)\n", hDC, enabled);
+
+ if (!hDC)
+ return E_HDCINVALID;
+
+ len = GetOutlineTextMetricsA(hDC, 0, NULL);
+ if (!len)
+ return E_ERRORACCESSINGFACENAME;
+
+ otm = HeapAlloc(GetProcessHeap(), 0, len);
+ if (!otm)
+ return E_NOFREEMEMORY;
+
+ GetOutlineTextMetricsA(hDC, len, otm);
+ ret = TTIsEmbeddingEnabledForFacename(otm->otmpFaceName, enabled);
+ HeapFree(GetProcessHeap(), 0, otm);
+ return ret;
}
LONG WINAPI TTDeleteEmbeddedFont(HANDLE hFontReference, ULONG flags, ULONG *status)
Modified: trunk/reactos/dll/win32/t2embed/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/t2embed/stubs.c?…
==============================================================================
--- trunk/reactos/dll/win32/t2embed/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/t2embed/stubs.c [iso-8859-1] Sat Jul 2 13:14:52 2016
@@ -68,15 +68,6 @@
LONG
WINAPI
-TTIsEmbeddingEnabledForFacename(LPSTR lpszFacename,
- BOOL* pbEnabled)
-{
- UNIMPLEMENTED;
- return E_NONE;
-}
-
-LONG
-WINAPI
TTRunValidationTests(HDC hDC,
TTVALIDATIONTESTPARAMS* pTestParam)
{
Modified: trunk/reactos/dll/win32/t2embed/t2embed.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/t2embed/t2embed.…
==============================================================================
--- trunk/reactos/dll/win32/t2embed/t2embed.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/t2embed/t2embed.spec [iso-8859-1] Sat Jul 2 13:14:52 2016
@@ -1,11 +1,11 @@
@ stdcall TTCharToUnicode(ptr ptr long ptr long long)
-@ stdcall TTDeleteEmbeddedFont(ptr long ptr)
-@ stdcall TTEmbedFont(ptr long long ptr ptr ptr ptr ptr long long ptr)
+@ stdcall TTDeleteEmbeddedFont(long long ptr)
+@ stdcall TTEmbedFont(long long long ptr ptr ptr ptr ptr long long ptr)
@ stdcall TTEmbedFontFromFileA(ptr str long long long ptr ptr ptr ptr ptr long long ptr)
@ stdcall TTEnableEmbeddingForFacename(str long)
@ stdcall TTGetEmbeddedFontInfo(long ptr long ptr ptr ptr ptr)
-@ stdcall TTGetEmbeddingType(ptr ptr)
-@ stdcall TTIsEmbeddingEnabled(ptr ptr)
+@ stdcall TTGetEmbeddingType(long ptr)
+@ stdcall TTIsEmbeddingEnabled(long ptr)
@ stdcall TTIsEmbeddingEnabledForFacename(str ptr)
@ stdcall TTLoadEmbeddedFont(ptr long ptr long ptr ptr ptr wstr str ptr)
@ stdcall TTRunValidationTests(ptr ptr)
@@ -17,7 +17,7 @@
@ stub _TTGetEmbeddedFontInfo@28
@ stdcall _TTGetEmbeddingType@8(long ptr) TTGetEmbeddingType
@ stdcall _TTIsEmbeddingEnabled@8(long ptr) TTIsEmbeddingEnabled
-@ stub _TTIsEmbeddingEnabledForFacename@8
+@ stdcall _TTIsEmbeddingEnabledForFacename@8(str ptr) TTIsEmbeddingEnabledForFacename
@ stdcall _TTLoadEmbeddedFont@40(ptr long ptr long ptr ptr ptr wstr str ptr)
TTLoadEmbeddedFont
@ stub _TTRunValidationTests@8
@ stdcall TTEmbedFontEx(ptr long long ptr ptr ptr ptr ptr long long ptr)
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Jul 2 13:14:52 2016
@@ -186,7 +186,7 @@
reactos/dll/win32/stdole32.tlb # Synced to WineStaging-1.9.4
reactos/dll/win32/sti # Synced to WineStaging-1.9.4
reactos/dll/win32/sxs # Synced to WineStaging-1.9.4
-reactos/dll/win32/t2embed # Synced to WineStaging-1.9.4
+reactos/dll/win32/t2embed # Synced to WineStaging-1.9.11
reactos/dll/win32/tapi32 # Synced to WineStaging-1.9.4
reactos/dll/win32/traffic # Synced to WineStaging-1.9.4
reactos/dll/win32/twain_32 # Synced to WineStaging-1.9.4
Modified: trunk/reactos/sdk/include/psdk/t2embapi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/t2embapi.…
==============================================================================
--- trunk/reactos/sdk/include/psdk/t2embapi.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/psdk/t2embapi.h [iso-8859-1] Sat Jul 2 13:14:52 2016
@@ -233,7 +233,7 @@
LONG
WINAPI
-TTIsEmbeddingEnabledForFacename(LPSTR lpszFacename,
+TTIsEmbeddingEnabledForFacename(LPCSTR lpszFacename,
BOOL* pbEnabled);
LONG