mlang: A very basic implementation of the IMLangLineBreakConsole interface and IMLangString interface.

This commit is contained in:
Aric Stewart 2008-07-22 10:01:49 +09:00 committed by Alexandre Julliard
parent 0b728a0bb0
commit 75d44fe46d
2 changed files with 180 additions and 0 deletions

View File

@ -962,6 +962,7 @@ typedef struct tagMLang_impl
const IMultiLanguageVtbl *vtbl_IMultiLanguage;
const IMultiLanguage3Vtbl *vtbl_IMultiLanguage3;
const IMLangFontLink2Vtbl *vtbl_IMLangFontLink2;
const IMLangLineBreakConsoleVtbl *vtbl_IMLangLineBreakConsole;
LONG ref;
DWORD total_cp, total_scripts;
} MLang_impl;
@ -1035,6 +1036,15 @@ static HRESULT WINAPI MLang_QueryInterface(
return S_OK;
}
if (IsEqualGUID(riid, &IID_IMLangLineBreakConsole))
{
MLang_AddRef(This);
TRACE("Returning IID_IMLangLineBreakConsole %p ref = %d\n", This, This->ref);
*ppvObject = &(This->vtbl_IMLangLineBreakConsole);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
return E_NOINTERFACE;
}
@ -2696,6 +2706,87 @@ static const IMLangFontLink2Vtbl IMLangFontLink2_vtbl =
fnIMLangFontLink2_CodePageToScriptID
};
/******************************************************************************/
static HRESULT WINAPI fnIMLangLineBreakConsole_QueryInterface(
IMLangLineBreakConsole* iface,
REFIID riid,
void** ppvObject)
{
ICOM_THIS_MULTI(MLang_impl, vtbl_IMLangLineBreakConsole, iface);
return MLang_QueryInterface( This, riid, ppvObject );
}
static ULONG WINAPI fnIMLangLineBreakConsole_AddRef(
IMLangLineBreakConsole* iface )
{
ICOM_THIS_MULTI(MLang_impl, vtbl_IMLangLineBreakConsole, iface);
return MLang_AddRef( This );
}
static ULONG WINAPI fnIMLangLineBreakConsole_Release(
IMLangLineBreakConsole* iface )
{
ICOM_THIS_MULTI(MLang_impl, vtbl_IMLangLineBreakConsole, iface);
return MLang_Release( This );
}
static HRESULT WINAPI fnIMLangLineBreakConsole_BreakLineML(
IMLangLineBreakConsole* iface,
IMLangString* pSrcMLStr,
long lSrcPos,
long lSrcLen,
long cMinColumns,
long cMaxColumns,
long* plLineLen,
long* plSkipLen)
{
FIXME("(%p)->%p %li %li %li %li %p %p\n", iface, pSrcMLStr, lSrcPos, lSrcLen, cMinColumns, cMaxColumns, plLineLen, plSkipLen);
return E_NOTIMPL;
}
static HRESULT WINAPI fnIMLangLineBreakConsole_BreakLineW(
IMLangLineBreakConsole* iface,
LCID locale,
const WCHAR* pszSrc,
long cchSrc,
long cMaxColumns,
long* pcchLine,
long* pcchSkip )
{
FIXME("(%p)->%i %s %li %li %p %p\n", iface, locale, debugstr_wn(pszSrc,cchSrc), cchSrc, cMaxColumns, pcchLine, pcchSkip);
*pcchLine = cchSrc;
*pcchSkip = 0;
return S_OK;
}
static HRESULT WINAPI fnIMLangLineBreakConsole_BreakLineA(
IMLangLineBreakConsole* iface,
LCID locale,
UINT uCodePage,
const CHAR* pszSrc,
long cchSrc,
long cMaxColumns,
long* pcchLine,
long* pcchSkip)
{
FIXME("(%p)->%i %i %s %li %li %p %p\n", iface, locale, uCodePage, debugstr_an(pszSrc,cchSrc), cchSrc, cMaxColumns, pcchLine, pcchSkip);
*pcchLine = cchSrc;
*pcchSkip = 0;
return S_OK;
}
static const IMLangLineBreakConsoleVtbl IMLangLineBreakConsole_vtbl =
{
fnIMLangLineBreakConsole_QueryInterface,
fnIMLangLineBreakConsole_AddRef,
fnIMLangLineBreakConsole_Release,
fnIMLangLineBreakConsole_BreakLineML,
fnIMLangLineBreakConsole_BreakLineW,
fnIMLangLineBreakConsole_BreakLineA
};
static HRESULT MultiLanguage_create(IUnknown *pUnkOuter, LPVOID *ppObj)
{
@ -2712,6 +2803,7 @@ static HRESULT MultiLanguage_create(IUnknown *pUnkOuter, LPVOID *ppObj)
mlang->vtbl_IMultiLanguage = &IMultiLanguage_vtbl;
mlang->vtbl_IMultiLanguage3 = &IMultiLanguage3_vtbl;
mlang->vtbl_IMLangFontLink2 = &IMLangFontLink2_vtbl;
mlang->vtbl_IMLangLineBreakConsole = &IMLangLineBreakConsole_vtbl;
mlang->total_cp = 0;
for (i = 0; i < sizeof(mlang_data)/sizeof(mlang_data[0]); i++)

View File

@ -221,6 +221,94 @@ interface IMLangFontLink2 : IMLangCodePages
[out] SCRIPT_ID *pSid);
}
[
object,
uuid(c04d65ce-b70d-11d0-b188-00aa0038c969),
pointer_default(unique)
]
interface IMLangString : IUnknown
{
#ifdef NEWMLSTR
HRESULT LockMLStr(
[in] long lPos,
[in] DWORD dwFlags,
[out] DWORD* pdwCookie,
[out] long* plActualPos,
[out] long* plActualLen);
HRESULT UnlockMLStr(
[in] DWORD dwCookie);
#else
HRESULT Sync(
[in] BOOL fNoAccess);
#endif
HRESULT GetLength(
[out, retval] long* plLen);
HRESULT SetMLStr(
[in] long lDestPos,
[in] long lDestLen,
[in] IUnknown *pSrcMLStr,
[in] long lSrcPos,
[in] long lSrcLen);
#ifdef NEWMLSTR
HRESULT RegisterAttr(
[in] IUnknown *pUnk,
[out] DWORD* pdwCookie);
HRESULT UnregisterAttr(
[in] DWORD dwCookie);
HRESULT EnumAttr(
[out] IEnumUnknown **ppEnumUnk);
HRESULT FindAttr(
[in] REFIID riid,
[in] LPARAM lParam,
[out] IUnknown **ppUnk);
#else
HRESULT GetMLStr(
[in] long lSrcPos,
[in] long lSrcLen,
[in] IUnknown *pUnkOuter,
[in] DWORD dwClsContext,
[in] const IID* piid,
[out] IUnknown** ppDestMLStr,
[out] long* plDestPos,
[out] long* plDestLen);
#endif
}
[
object,
uuid(f5be2ee1-bfd7-11d0-b188-00aa0038c969),
pointer_default(unique)
]
interface IMLangLineBreakConsole : IUnknown
{
HRESULT BreakLineML(
[in] IMLangString* pSrcMLStr,
[in] long lSrcPos,
[in] long lSrcLen,
[in] long cMinColumns,
[in] long cMaxColumns,
[out] long* plLineLen,
[out] long* plSkipLen);
HRESULT BreakLineW(
[in] LCID locale,
[in, size_is(cchSrc)] const WCHAR* pszSrc,
[in] long cchSrc,
[in] long cMaxColumns,
[out] long* pcchLine,
[out] long* pcchSkip );
HRESULT BreakLineA(
[in] LCID locale,
[in] UINT uCodePage,
[in, size_is(cchSrc)] const CHAR* pszSrc,
[in] long cchSrc,
[in] long cMaxColumns,
[out] long* pcchLine,
[out] long* pcchSkip);
}
[
object,
uuid(275c23e3-3747-11d0-9fea-00aa003f8646),