2004-08-15 18:40:07 +00:00
|
|
|
#include "precomp.h"
|
2000-06-16 07:36:10 +00:00
|
|
|
|
2003-07-20 16:47:05 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
UINT
|
|
|
|
STDCALL
|
|
|
|
SetTextAlign(
|
2004-04-25 14:46:54 +00:00
|
|
|
HDC hdc,
|
|
|
|
UINT fMode
|
2003-07-20 16:47:05 +00:00
|
|
|
)
|
|
|
|
{
|
2004-04-25 14:46:54 +00:00
|
|
|
return NtGdiSetTextAlign(hdc, fMode);
|
2003-07-20 16:47:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-10 15:35:49 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2000-06-16 07:36:10 +00:00
|
|
|
BOOL
|
|
|
|
STDCALL
|
|
|
|
TextOutA(
|
2004-04-25 14:46:54 +00:00
|
|
|
HDC hdc,
|
|
|
|
int nXStart,
|
|
|
|
int nYStart,
|
|
|
|
LPCSTR lpString,
|
|
|
|
int cbString)
|
2000-06-16 07:36:10 +00:00
|
|
|
{
|
|
|
|
ANSI_STRING StringA;
|
|
|
|
UNICODE_STRING StringU;
|
|
|
|
BOOL ret;
|
|
|
|
|
2004-04-25 14:46:54 +00:00
|
|
|
if (NULL != lpString)
|
2000-06-16 07:36:10 +00:00
|
|
|
{
|
2004-04-25 14:46:54 +00:00
|
|
|
RtlInitAnsiString(&StringA, (LPSTR)lpString);
|
2000-06-16 07:36:10 +00:00
|
|
|
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
|
|
|
} else
|
|
|
|
StringU.Buffer = NULL;
|
|
|
|
|
2004-04-25 14:46:54 +00:00
|
|
|
ret = TextOutW(hdc, nXStart, nYStart, StringU.Buffer, cbString);
|
2000-06-16 07:36:10 +00:00
|
|
|
RtlFreeUnicodeString(&StringU);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2003-07-10 15:35:49 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2000-06-16 07:36:10 +00:00
|
|
|
BOOL
|
|
|
|
STDCALL
|
|
|
|
TextOutW(
|
2004-04-25 14:46:54 +00:00
|
|
|
HDC hdc,
|
|
|
|
int nXStart,
|
|
|
|
int nYStart,
|
|
|
|
LPCWSTR lpString,
|
|
|
|
int cbString)
|
2000-06-16 07:36:10 +00:00
|
|
|
{
|
2004-04-25 14:46:54 +00:00
|
|
|
return NtGdiTextOut(hdc, nXStart, nYStart, lpString, cbString);
|
2000-06-16 07:36:10 +00:00
|
|
|
}
|
2001-05-02 12:35:06 +00:00
|
|
|
|
2003-07-10 15:35:49 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2002-09-17 23:41:44 +00:00
|
|
|
COLORREF STDCALL
|
2004-04-25 14:46:54 +00:00
|
|
|
SetTextColor(HDC hdc, COLORREF crColor)
|
2001-05-02 12:35:06 +00:00
|
|
|
{
|
2004-04-25 14:46:54 +00:00
|
|
|
return NtGdiSetTextColor(hdc, crColor);
|
2001-05-02 12:35:06 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 15:35:49 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2001-05-02 12:35:06 +00:00
|
|
|
BOOL
|
|
|
|
STDCALL
|
|
|
|
GetTextMetricsA(
|
|
|
|
HDC hdc,
|
2004-04-25 14:46:54 +00:00
|
|
|
LPTEXTMETRICA lptm
|
2001-05-02 12:35:06 +00:00
|
|
|
)
|
|
|
|
{
|
2003-05-16 18:55:27 +00:00
|
|
|
TEXTMETRICW tmw;
|
|
|
|
|
2003-08-19 11:48:50 +00:00
|
|
|
if (! NtGdiGetTextMetrics(hdc, &tmw))
|
2003-05-16 18:55:27 +00:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2004-04-25 14:46:54 +00:00
|
|
|
return TextMetricW2A(lptm, &tmw);
|
2001-05-02 12:35:06 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 15:35:49 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2001-05-02 12:35:06 +00:00
|
|
|
BOOL
|
|
|
|
STDCALL
|
|
|
|
GetTextMetricsW(
|
|
|
|
HDC hdc,
|
2004-04-25 14:46:54 +00:00
|
|
|
LPTEXTMETRICW lptm
|
2001-05-02 12:35:06 +00:00
|
|
|
)
|
|
|
|
{
|
2004-04-25 14:46:54 +00:00
|
|
|
return NtGdiGetTextMetrics(hdc, lptm);
|
2001-05-02 12:35:06 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 15:35:49 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2001-05-02 12:35:06 +00:00
|
|
|
BOOL
|
|
|
|
APIENTRY
|
|
|
|
GetTextExtentPointA(
|
2004-04-25 14:46:54 +00:00
|
|
|
HDC hdc,
|
|
|
|
LPCSTR lpString,
|
|
|
|
int cbString,
|
|
|
|
LPSIZE lpSize
|
2001-05-02 12:35:06 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
ANSI_STRING StringA;
|
|
|
|
UNICODE_STRING StringU;
|
|
|
|
BOOL ret;
|
|
|
|
|
2004-04-25 14:46:54 +00:00
|
|
|
RtlInitAnsiString(&StringA, (LPSTR)lpString);
|
2001-05-02 12:35:06 +00:00
|
|
|
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
|
|
|
|
2004-04-25 14:46:54 +00:00
|
|
|
ret = GetTextExtentPointW(hdc, StringU.Buffer, cbString, lpSize);
|
2001-05-02 12:35:06 +00:00
|
|
|
|
|
|
|
RtlFreeUnicodeString(&StringU);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2003-07-10 15:35:49 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2001-05-02 12:35:06 +00:00
|
|
|
BOOL
|
|
|
|
APIENTRY
|
|
|
|
GetTextExtentPointW(
|
2004-04-25 14:46:54 +00:00
|
|
|
HDC hdc,
|
|
|
|
LPCWSTR lpString,
|
|
|
|
int cbString,
|
|
|
|
LPSIZE lpSize
|
2001-05-02 12:35:06 +00:00
|
|
|
)
|
|
|
|
{
|
2004-04-25 14:46:54 +00:00
|
|
|
return NtGdiGetTextExtentPoint(hdc, lpString, cbString, lpSize);
|
2001-05-02 12:35:06 +00:00
|
|
|
}
|
|
|
|
|
2003-06-22 21:33:48 +00:00
|
|
|
|
2003-07-10 15:35:49 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2003-06-22 21:33:48 +00:00
|
|
|
BOOL
|
|
|
|
APIENTRY
|
|
|
|
GetTextExtentPoint32A(
|
2004-04-25 14:46:54 +00:00
|
|
|
HDC hdc,
|
|
|
|
LPCSTR lpString,
|
|
|
|
int cbString,
|
|
|
|
LPSIZE lpSize
|
2003-06-22 21:33:48 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
ANSI_STRING StringA;
|
|
|
|
UNICODE_STRING StringU;
|
|
|
|
BOOL ret;
|
|
|
|
|
2004-04-25 14:46:54 +00:00
|
|
|
RtlInitAnsiString(&StringA, (LPSTR)lpString);
|
2003-06-22 21:33:48 +00:00
|
|
|
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
|
|
|
|
2004-04-25 14:46:54 +00:00
|
|
|
ret = GetTextExtentPoint32W(hdc, StringU.Buffer, cbString, lpSize);
|
2003-06-22 21:33:48 +00:00
|
|
|
|
|
|
|
RtlFreeUnicodeString(&StringU);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-10 15:35:49 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2003-06-22 21:33:48 +00:00
|
|
|
BOOL
|
|
|
|
APIENTRY
|
|
|
|
GetTextExtentPoint32W(
|
2004-04-25 14:46:54 +00:00
|
|
|
HDC hdc,
|
|
|
|
LPCWSTR lpString,
|
|
|
|
int cbString,
|
|
|
|
LPSIZE lpSize
|
2003-06-22 21:33:48 +00:00
|
|
|
)
|
|
|
|
{
|
2004-04-25 14:46:54 +00:00
|
|
|
return NtGdiGetTextExtentPoint32(hdc, lpString, cbString, lpSize);
|
2003-06-22 21:33:48 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 15:35:49 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2001-05-02 12:35:06 +00:00
|
|
|
BOOL
|
|
|
|
STDCALL
|
|
|
|
ExtTextOutA(
|
2004-04-25 14:46:54 +00:00
|
|
|
HDC hdc,
|
2001-05-02 12:35:06 +00:00
|
|
|
int X,
|
|
|
|
int Y,
|
2004-04-25 14:46:54 +00:00
|
|
|
UINT fuOptions,
|
|
|
|
CONST RECT *lprc,
|
|
|
|
LPCSTR lpString,
|
|
|
|
UINT cbCount,
|
|
|
|
CONST INT *lpDx
|
2001-05-02 12:35:06 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
ANSI_STRING StringA;
|
|
|
|
UNICODE_STRING StringU;
|
|
|
|
BOOL ret;
|
|
|
|
|
2004-04-25 14:46:54 +00:00
|
|
|
RtlInitAnsiString(&StringA, (LPSTR)lpString);
|
2001-05-02 12:35:06 +00:00
|
|
|
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
|
|
|
|
2004-04-25 14:46:54 +00:00
|
|
|
ret = ExtTextOutW(hdc, X, Y, fuOptions, lprc, StringU.Buffer, cbCount, lpDx);
|
2001-05-02 12:35:06 +00:00
|
|
|
|
|
|
|
RtlFreeUnicodeString(&StringU);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2003-07-10 15:35:49 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2001-05-02 12:35:06 +00:00
|
|
|
BOOL
|
|
|
|
STDCALL
|
|
|
|
ExtTextOutW(
|
2003-12-08 20:58:44 +00:00
|
|
|
HDC hdc,
|
2001-05-02 12:35:06 +00:00
|
|
|
int X,
|
|
|
|
int Y,
|
2003-12-08 20:58:44 +00:00
|
|
|
UINT fuOptions,
|
2004-04-25 14:46:54 +00:00
|
|
|
CONST RECT *lprc,
|
2003-12-08 20:58:44 +00:00
|
|
|
LPCWSTR lpString,
|
|
|
|
UINT cbCount,
|
|
|
|
CONST INT *lpDx
|
2001-05-02 12:35:06 +00:00
|
|
|
)
|
|
|
|
{
|
2004-04-25 14:46:54 +00:00
|
|
|
return NtGdiExtTextOut(hdc, X, Y, fuOptions, lprc, lpString, cbCount, lpDx);
|
2001-05-02 12:35:06 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 15:35:49 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2001-05-02 12:35:06 +00:00
|
|
|
HFONT
|
|
|
|
STDCALL
|
|
|
|
CreateFontIndirectA(
|
2004-04-25 14:46:54 +00:00
|
|
|
CONST LOGFONTA *lplf
|
2001-05-02 12:35:06 +00:00
|
|
|
)
|
|
|
|
{
|
2004-03-27 21:07:33 +00:00
|
|
|
LOGFONTW tlf;
|
2001-05-02 12:35:06 +00:00
|
|
|
|
2004-04-25 14:46:54 +00:00
|
|
|
RosRtlLogFontA2W(&tlf, lplf);
|
2001-05-02 12:35:06 +00:00
|
|
|
|
2004-03-27 21:07:33 +00:00
|
|
|
return NtGdiCreateFontIndirect(&tlf);
|
2001-05-02 12:35:06 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 15:35:49 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2001-05-02 12:35:06 +00:00
|
|
|
HFONT
|
|
|
|
STDCALL
|
|
|
|
CreateFontIndirectW(
|
2004-04-25 14:46:54 +00:00
|
|
|
CONST LOGFONTW *lplf
|
2001-05-02 12:35:06 +00:00
|
|
|
)
|
|
|
|
{
|
2004-04-25 14:46:54 +00:00
|
|
|
return NtGdiCreateFontIndirect((CONST LPLOGFONTW)lplf);
|
2001-05-02 12:35:06 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 15:35:49 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2001-05-02 12:35:06 +00:00
|
|
|
HFONT
|
|
|
|
STDCALL
|
|
|
|
CreateFontA(
|
2004-04-25 14:46:54 +00:00
|
|
|
int nHeight,
|
|
|
|
int nWidth,
|
|
|
|
int nEscapement,
|
|
|
|
int nOrientation,
|
|
|
|
int fnWeight,
|
|
|
|
DWORD fdwItalic,
|
|
|
|
DWORD fdwUnderline,
|
|
|
|
DWORD fdwStrikeOut,
|
|
|
|
DWORD fdwCharSet,
|
|
|
|
DWORD fdwOutputPrecision,
|
|
|
|
DWORD fdwClipPrecision,
|
|
|
|
DWORD fdwQuality,
|
|
|
|
DWORD fdwPitchAndFamily,
|
|
|
|
LPCSTR lpszFace
|
2001-05-02 12:35:06 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
ANSI_STRING StringA;
|
|
|
|
UNICODE_STRING StringU;
|
2001-06-29 19:34:35 +00:00
|
|
|
HFONT ret;
|
2001-05-02 12:35:06 +00:00
|
|
|
|
2004-04-25 14:46:54 +00:00
|
|
|
RtlInitAnsiString(&StringA, (LPSTR)lpszFace);
|
2001-05-02 12:35:06 +00:00
|
|
|
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
|
|
|
|
2004-04-25 14:46:54 +00:00
|
|
|
ret = CreateFontW(nHeight, nWidth, nEscapement, nOrientation, fnWeight, fdwItalic, fdwUnderline, fdwStrikeOut,
|
|
|
|
fdwCharSet, fdwOutputPrecision, fdwClipPrecision, fdwQuality, fdwPitchAndFamily, StringU.Buffer);
|
2001-05-02 12:35:06 +00:00
|
|
|
|
|
|
|
RtlFreeUnicodeString(&StringU);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2003-07-10 15:35:49 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2001-05-02 12:35:06 +00:00
|
|
|
HFONT
|
|
|
|
STDCALL
|
|
|
|
CreateFontW(
|
2004-04-25 14:46:54 +00:00
|
|
|
int nHeight,
|
|
|
|
int nWidth,
|
|
|
|
int nEscapement,
|
|
|
|
int nOrientation,
|
|
|
|
int nWeight,
|
|
|
|
DWORD fnItalic,
|
|
|
|
DWORD fdwUnderline,
|
|
|
|
DWORD fdwStrikeOut,
|
|
|
|
DWORD fdwCharSet,
|
|
|
|
DWORD fdwOutputPrecision,
|
|
|
|
DWORD fdwClipPrecision,
|
|
|
|
DWORD fdwQuality,
|
|
|
|
DWORD fdwPitchAndFamily,
|
|
|
|
LPCWSTR lpszFace
|
2001-05-02 12:35:06 +00:00
|
|
|
)
|
|
|
|
{
|
2004-04-25 14:46:54 +00:00
|
|
|
return NtGdiCreateFont(nHeight, nWidth, nEscapement, nOrientation, nWeight, fnItalic, fdwUnderline, fdwStrikeOut,
|
|
|
|
fdwCharSet, fdwOutputPrecision, fdwClipPrecision, fdwQuality, fdwPitchAndFamily, lpszFace);
|
2001-05-02 12:35:06 +00:00
|
|
|
}
|
2002-09-17 23:41:44 +00:00
|
|
|
|