Commit d5af0175 authored by Gael de Chalendar's avatar Gael de Chalendar Committed by Alexandre Julliard

Partially complete GetTextCharsetInfo and corrects return values for

this family of functions.
parent 1509b2d0
...@@ -6883,7 +6883,7 @@ BOOL32 WINAPI GetStringTypeEx32W(LCID,DWORD,LPCWSTR,INT32,LPWORD); ...@@ -6883,7 +6883,7 @@ BOOL32 WINAPI GetStringTypeEx32W(LCID,DWORD,LPCWSTR,INT32,LPWORD);
VOID WINAPI GetSystemInfo(LPSYSTEM_INFO); VOID WINAPI GetSystemInfo(LPSYSTEM_INFO);
BOOL32 WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS); BOOL32 WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS);
VOID WINAPI GetSystemTime(LPSYSTEMTIME); VOID WINAPI GetSystemTime(LPSYSTEMTIME);
INT32 WINAPI GetTextCharsetInfo(HDC32,LPCHARSETINFO,DWORD); UINT32 WINAPI GetTextCharsetInfo(HDC32,LPFONTSIGNATURE,DWORD);
BOOL32 WINAPI GetTextExtentExPoint32A(HDC32,LPCSTR,INT32,INT32, BOOL32 WINAPI GetTextExtentExPoint32A(HDC32,LPCSTR,INT32,INT32,
LPINT32,LPINT32,LPSIZE32); LPINT32,LPINT32,LPSIZE32);
BOOL32 WINAPI GetTextExtentExPoint32W(HDC32,LPCWSTR,INT32,INT32, BOOL32 WINAPI GetTextExtentExPoint32W(HDC32,LPCWSTR,INT32,INT32,
...@@ -8314,8 +8314,8 @@ UINT32 WINAPI GetTextAlign32(HDC32); ...@@ -8314,8 +8314,8 @@ UINT32 WINAPI GetTextAlign32(HDC32);
INT16 WINAPI GetTextCharacterExtra16(HDC16); INT16 WINAPI GetTextCharacterExtra16(HDC16);
INT32 WINAPI GetTextCharacterExtra32(HDC32); INT32 WINAPI GetTextCharacterExtra32(HDC32);
#define GetTextCharacterExtra WINELIB_NAME(GetTextCharacterExtra) #define GetTextCharacterExtra WINELIB_NAME(GetTextCharacterExtra)
INT16 WINAPI GetTextCharset16(HDC16); UINT16 WINAPI GetTextCharset16(HDC16);
INT32 WINAPI GetTextCharset32(HDC32); UINT32 WINAPI GetTextCharset32(HDC32);
#define GetTextCharset WINELIB_NAME(GetTextCharset) #define GetTextCharset WINELIB_NAME(GetTextCharset)
COLORREF WINAPI GetTextColor16(HDC16); COLORREF WINAPI GetTextColor16(HDC16);
COLORREF WINAPI GetTextColor32(HDC32); COLORREF WINAPI GetTextColor32(HDC32);
......
...@@ -721,12 +721,13 @@ DWORD WINAPI GetTabbedTextExtent32W( HDC32 hdc, LPCWSTR lpstr, INT32 count, ...@@ -721,12 +721,13 @@ DWORD WINAPI GetTabbedTextExtent32W( HDC32 hdc, LPCWSTR lpstr, INT32 count,
* *
* NOTES * NOTES
* Should it return a UINT32 instead of an INT32? * Should it return a UINT32 instead of an INT32?
* => YES, as GetTextCharsetInfo returns UINT32
* *
* RETURNS * RETURNS
* Success: Character set identifier * Success: Character set identifier
* Failure: DEFAULT_CHARSET * Failure: DEFAULT_CHARSET
*/ */
INT32 WINAPI GetTextCharset32( UINT32 WINAPI GetTextCharset32(
HDC32 hdc) /* [in] Handle to device context */ HDC32 hdc) /* [in] Handle to device context */
{ {
/* MSDN docs say this is equivalent */ /* MSDN docs say this is equivalent */
...@@ -736,9 +737,9 @@ INT32 WINAPI GetTextCharset32( ...@@ -736,9 +737,9 @@ INT32 WINAPI GetTextCharset32(
/*********************************************************************** /***********************************************************************
* GetTextCharset16 [GDI.612] * GetTextCharset16 [GDI.612]
*/ */
INT16 WINAPI GetTextCharset16(HDC16 hdc) UINT16 WINAPI GetTextCharset16(HDC16 hdc)
{ {
return GetTextCharset32(hdc); return (UINT16)GetTextCharset32(hdc);
} }
/*********************************************************************** /***********************************************************************
...@@ -747,21 +748,31 @@ INT16 WINAPI GetTextCharset16(HDC16 hdc) ...@@ -747,21 +748,31 @@ INT16 WINAPI GetTextCharset16(HDC16 hdc)
* NOTES * NOTES
* Should csi be an LPFONTSIGNATURE instead of an LPCHARSETINFO? * Should csi be an LPFONTSIGNATURE instead of an LPCHARSETINFO?
* Should it return a UINT32 instead of an INT32? * Should it return a UINT32 instead of an INT32?
* => YES and YES, from win32.hlp from Borland
* *
* RETURNS * RETURNS
* Success: Character set identifier * Success: Character set identifier
* Failure: DEFAULT_CHARSET * Failure: DEFAULT_CHARSET
*/ */
INT32 WINAPI GetTextCharsetInfo( UINT32 WINAPI GetTextCharsetInfo(
HDC32 hdc, /* [in] Handle to device context */ HDC32 hdc, /* [in] Handle to device context */
LPCHARSETINFO csi, /* [out] Pointer to struct to receive data */ LPFONTSIGNATURE fs, /* [out] Pointer to struct to receive data */
DWORD flags) /* [in] Reserved - must be 0 */ DWORD flags) /* [in] Reserved - must be 0 */
{ {
FIXME(text,"(0x%x,%p,%08lx): stub\n",hdc,csi,flags); HGDIOBJ32 hFont;
if (csi) { UINT32 charSet = DEFAULT_CHARSET;
csi->ciCharset = DEFAULT_CHARSET; LOGFONT32W lf;
csi->ciACP = GetACP();
if (fs != NULL)
FIXME(text,"(0x%x,%p,%08lx): stub\n",hdc,fs,flags);
hFont = GetCurrentObject(hdc, OBJ_FONT);
if (hFont == 0)
return(DEFAULT_CHARSET);
if ( GetObject32W(hFont, sizeof(LOGFONT32W), &lf) != 0 )
charSet = lf.lfCharSet;
if (fs != NULL) {
/* ... fill fontstruct too ... still to do*/
} }
/* ... fill fontstruct too ... */ return charSet;
return DEFAULT_CHARSET;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment