mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:25:39 +00:00
- Removed NtGdiTranslateCharsetInfo, updated w32ksvc.db and ntgdibad.h.
- Implemented TranslateCharsetInfo from wine. Works the same just different. svn path=/trunk/; revision=30098
This commit is contained in:
parent
0029160b44
commit
d4a8d54b73
5 changed files with 93 additions and 45 deletions
|
@ -21,19 +21,6 @@
|
||||||
#define UNIMPLEMENTED DbgPrint("GDI32: %s is unimplemented, please try again later.\n", __FUNCTION__);
|
#define UNIMPLEMENTED DbgPrint("GDI32: %s is unimplemented, please try again later.\n", __FUNCTION__);
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
BOOL
|
|
||||||
STDCALL
|
|
||||||
TranslateCharsetInfo(DWORD * lpSrc,
|
|
||||||
LPCHARSETINFO lpCs,
|
|
||||||
DWORD dwFlags)
|
|
||||||
{
|
|
||||||
/* FIXME share memory */
|
|
||||||
return NtGdiTranslateCharsetInfo(lpSrc, lpCs, dwFlags );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -13,6 +13,51 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For TranslateCharsetInfo
|
||||||
|
*/
|
||||||
|
#define FS(x) {{0,0,0,0},{0x1<<(x),0}}
|
||||||
|
#define MAXTCIINDEX 32
|
||||||
|
static const CHARSETINFO FONT_tci[MAXTCIINDEX] = {
|
||||||
|
/* ANSI */
|
||||||
|
{ ANSI_CHARSET, 1252, FS(0)},
|
||||||
|
{ EASTEUROPE_CHARSET, 1250, FS(1)},
|
||||||
|
{ RUSSIAN_CHARSET, 1251, FS(2)},
|
||||||
|
{ GREEK_CHARSET, 1253, FS(3)},
|
||||||
|
{ TURKISH_CHARSET, 1254, FS(4)},
|
||||||
|
{ HEBREW_CHARSET, 1255, FS(5)},
|
||||||
|
{ ARABIC_CHARSET, 1256, FS(6)},
|
||||||
|
{ BALTIC_CHARSET, 1257, FS(7)},
|
||||||
|
{ VIETNAMESE_CHARSET, 1258, FS(8)},
|
||||||
|
/* reserved by ANSI */
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
/* ANSI and OEM */
|
||||||
|
{ THAI_CHARSET, 874, FS(16)},
|
||||||
|
{ SHIFTJIS_CHARSET, 932, FS(17)},
|
||||||
|
{ GB2312_CHARSET, 936, FS(18)},
|
||||||
|
{ HANGEUL_CHARSET, 949, FS(19)},
|
||||||
|
{ CHINESEBIG5_CHARSET, 950, FS(20)},
|
||||||
|
{ JOHAB_CHARSET, 1361, FS(21)},
|
||||||
|
/* reserved for alternate ANSI and OEM */
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
/* reserved for system */
|
||||||
|
{ DEFAULT_CHARSET, 0, FS(0)},
|
||||||
|
{ SYMBOL_CHARSET, CP_SYMBOL, FS(31)},
|
||||||
|
};
|
||||||
|
|
||||||
#define INITIAL_FAMILY_COUNT 64
|
#define INITIAL_FAMILY_COUNT 64
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -1287,6 +1332,54 @@ GdiGetCharDimensions(HDC hdc, LPTEXTMETRICW lptm, LONG *height)
|
||||||
return (sz.cx / 26 + 1) / 2;
|
return (sz.cx / 26 + 1) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* TranslateCharsetInfo [GDI32.@]
|
||||||
|
*
|
||||||
|
* Fills a CHARSETINFO structure for a character set, code page, or
|
||||||
|
* font. This allows making the correspondance between different labelings
|
||||||
|
* (character set, Windows, ANSI, and OEM codepages, and Unicode ranges)
|
||||||
|
* of the same encoding.
|
||||||
|
*
|
||||||
|
* Only one codepage will be set in lpCs->fs. If TCI_SRCFONTSIG is used,
|
||||||
|
* only one codepage should be set in *lpSrc.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* TRUE on success, FALSE on failure.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* @unimplemented
|
||||||
|
*/
|
||||||
|
BOOL
|
||||||
|
STDCALL
|
||||||
|
TranslateCharsetInfo(
|
||||||
|
LPDWORD lpSrc, /* [in]
|
||||||
|
if flags == TCI_SRCFONTSIG: pointer to fsCsb of a FONTSIGNATURE
|
||||||
|
if flags == TCI_SRCCHARSET: a character set value
|
||||||
|
if flags == TCI_SRCCODEPAGE: a code page value
|
||||||
|
*/
|
||||||
|
LPCHARSETINFO lpCs, /* [out] structure to receive charset information */
|
||||||
|
DWORD flags /* [in] determines interpretation of lpSrc */)
|
||||||
|
{
|
||||||
|
int index = 0;
|
||||||
|
switch (flags) {
|
||||||
|
case TCI_SRCFONTSIG:
|
||||||
|
while (!(*lpSrc>>index & 0x0001) && index<MAXTCIINDEX) index++;
|
||||||
|
break;
|
||||||
|
case TCI_SRCCODEPAGE:
|
||||||
|
while (PtrToUlong(lpSrc) != FONT_tci[index].ciACP && index < MAXTCIINDEX) index++;
|
||||||
|
break;
|
||||||
|
case TCI_SRCCHARSET:
|
||||||
|
while (PtrToUlong(lpSrc) != FONT_tci[index].ciCharset && index < MAXTCIINDEX) index++;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (index >= MAXTCIINDEX || FONT_tci[index].ciCharset == DEFAULT_CHARSET) return FALSE;
|
||||||
|
memcpy(lpCs, &FONT_tci[index], sizeof(CHARSETINFO));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
|
|
|
@ -59,15 +59,6 @@ NtGdiGetFontFamilyInfo(
|
||||||
DWORD Size
|
DWORD Size
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Should be using NtGdiEnumFontChunk */
|
|
||||||
BOOL
|
|
||||||
NTAPI
|
|
||||||
NtGdiTranslateCharsetInfo(
|
|
||||||
PDWORD Src,
|
|
||||||
LPCHARSETINFO CSI,
|
|
||||||
DWORD Flags
|
|
||||||
);
|
|
||||||
|
|
||||||
/* The gdi32 call does all the work in user-mode, save for NtGdiMakeFontDir */
|
/* The gdi32 call does all the work in user-mode, save for NtGdiMakeFontDir */
|
||||||
BOOL
|
BOOL
|
||||||
NTAPI
|
NTAPI
|
||||||
|
|
|
@ -646,28 +646,6 @@ IntTranslateCharsetInfo(PDWORD Src, /* [in]
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STDCALL
|
|
||||||
NtGdiTranslateCharsetInfo(PDWORD Src,
|
|
||||||
LPCHARSETINFO UnsafeCs,
|
|
||||||
DWORD Flags)
|
|
||||||
{
|
|
||||||
CHARSETINFO Cs;
|
|
||||||
BOOLEAN Ret;
|
|
||||||
NTSTATUS Status;
|
|
||||||
|
|
||||||
Ret = IntTranslateCharsetInfo(Src, &Cs, Flags);
|
|
||||||
if (Ret)
|
|
||||||
{
|
|
||||||
Status = MmCopyToCaller(UnsafeCs, &Cs, sizeof(CHARSETINFO));
|
|
||||||
if (! NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (BOOL) Ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void FASTCALL
|
static void FASTCALL
|
||||||
FillTM(TEXTMETRICW *TM, FT_Face Face, TT_OS2 *pOS2, TT_HoriHeader *pHori)
|
FillTM(TEXTMETRICW *TM, FT_Face Face, TT_OS2 *pOS2, TT_HoriHeader *pHori)
|
||||||
|
|
|
@ -696,7 +696,6 @@ NtGdiSetViewportOrgEx 4
|
||||||
NtGdiSetWindowExtEx 4
|
NtGdiSetWindowExtEx 4
|
||||||
NtGdiSetWindowOrgEx 4
|
NtGdiSetWindowOrgEx 4
|
||||||
NtGdiStretchDIBits 13
|
NtGdiStretchDIBits 13
|
||||||
NtGdiTranslateCharsetInfo 3
|
|
||||||
NtGdiUpdateICMRegKey 4
|
NtGdiUpdateICMRegKey 4
|
||||||
NtUserBuildMenuItemList 4
|
NtUserBuildMenuItemList 4
|
||||||
NtUserCreateCursorIconHandle 2
|
NtUserCreateCursorIconHandle 2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue