From 5ee6fc75ae0e1e95c4ebf45308bbaedba18bd1bd Mon Sep 17 00:00:00 2001 From: Jason Filby Date: Wed, 2 May 2001 12:35:06 +0000 Subject: [PATCH] GDI32 support for new win32k functions svn path=/trunk/; revision=1862 --- reactos/lib/gdi32/misc/stubs.c | 15 +-- reactos/lib/gdi32/misc/stubsa.c | 83 +------------ reactos/lib/gdi32/misc/stubsw.c | 81 +------------ reactos/lib/gdi32/objects/text.c | 201 +++++++++++++++++++++++++++++++ 4 files changed, 204 insertions(+), 176 deletions(-) diff --git a/reactos/lib/gdi32/misc/stubs.c b/reactos/lib/gdi32/misc/stubs.c index 392f58ec236..63bb5d90456 100644 --- a/reactos/lib/gdi32/misc/stubs.c +++ b/reactos/lib/gdi32/misc/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.4 2000/07/07 00:37:52 phreak Exp $ +/* $Id: stubs.c,v 1.5 2001/05/02 12:35:06 jfilby Exp $ * * reactos/lib/gdi32/misc/stubs.c * @@ -1610,19 +1610,6 @@ SetTextCharacterExtra( -COLORREF -STDCALL -SetTextColor( - HDC a0, - COLORREF a1 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - - UINT STDCALL SetTextAlign( diff --git a/reactos/lib/gdi32/misc/stubsa.c b/reactos/lib/gdi32/misc/stubsa.c index 0d659ad1ad6..a09fe743651 100644 --- a/reactos/lib/gdi32/misc/stubsa.c +++ b/reactos/lib/gdi32/misc/stubsa.c @@ -1,4 +1,4 @@ -/* $Id: stubsa.c,v 1.4 2000/06/16 07:34:15 jfilby Exp $ +/* $Id: stubsa.c,v 1.5 2001/05/02 12:35:06 jfilby Exp $ * * reactos/lib/gdi32/misc/stubs.c * @@ -38,43 +38,6 @@ CopyMetaFileA( return 0; } - -HFONT -STDCALL -CreateFontIndirectA( - CONST LOGFONT *a0 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - - -HFONT -STDCALL -CreateFontA( - int a0, - int a1, - int a2, - int a3, - int a4, - DWORD a5, - DWORD a6, - DWORD a7, - DWORD a8, - DWORD a9, - DWORD a10, - DWORD a11, - DWORD a12, - LPCSTR a13 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - HDC STDCALL CreateICA( @@ -283,20 +246,6 @@ GetOutlineTextMetricsA( } -BOOL -APIENTRY -GetTextExtentPointA( - HDC hDc, - LPCSTR a1, - int a2, - LPSIZE a3 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - BOOL APIENTRY GetTextExtentPoint32A( @@ -417,18 +366,6 @@ GetEnhMetaFileDescriptionA( } -BOOL -STDCALL -GetTextMetricsA( - HDC hdc, - LPTEXTMETRIC a1 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - int STDCALL StartDocA( @@ -454,24 +391,6 @@ GetObjectA( } -BOOL -STDCALL -ExtTextOutA( - HDC hdc, - int a1, - int a2, - UINT a3, - CONST RECT *a4, - LPCSTR a5, - UINT a6, - CONST INT *a7 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - BOOL STDCALL PolyTextOutA( diff --git a/reactos/lib/gdi32/misc/stubsw.c b/reactos/lib/gdi32/misc/stubsw.c index c71e26782e3..d3edb79b259 100644 --- a/reactos/lib/gdi32/misc/stubsw.c +++ b/reactos/lib/gdi32/misc/stubsw.c @@ -1,4 +1,4 @@ -/* $Id: stubsw.c,v 1.3 2000/06/16 07:34:15 jfilby Exp $ +/* $Id: stubsw.c,v 1.4 2001/05/02 12:35:06 jfilby Exp $ * * reactos/lib/gdi32/misc/stubs.c * @@ -36,41 +36,6 @@ CopyMetaFileW( } -HFONT -STDCALL -CreateFontIndirectW( - CONST LOGFONT *a0 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -HFONT -STDCALL -CreateFontW( - int a0, - int a1, - int a2, - int a3, - int a4, - DWORD a5, - DWORD a6, - DWORD a7, - DWORD a8, - DWORD a9, - DWORD a10, - DWORD a11, - DWORD a12, - LPCWSTR a13 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - HDC STDCALL CreateICW( @@ -279,20 +244,6 @@ GetOutlineTextMetricsW( } -BOOL -APIENTRY -GetTextExtentPointW( - HDC hDc, - LPCWSTR a1, - int a2, - LPSIZE a3 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - BOOL APIENTRY GetTextExtentPoint32W( @@ -413,18 +364,6 @@ GetEnhMetaFileDescriptionW( } -BOOL -STDCALL -GetTextMetricsW( - HDC hdc, - LPTEXTMETRIC a1 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - int STDCALL StartDocW( @@ -450,24 +389,6 @@ GetObjectW( } -BOOL -STDCALL -ExtTextOutW( - HDC hdc, - int a1, - int a2, - UINT a3, - CONST RECT *a4, - LPCWSTR a5, - UINT a6, - CONST INT *a7 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - BOOL STDCALL PolyTextOutW( diff --git a/reactos/lib/gdi32/objects/text.c b/reactos/lib/gdi32/objects/text.c index acdc80fbd65..c66e48c5e6b 100644 --- a/reactos/lib/gdi32/objects/text.c +++ b/reactos/lib/gdi32/objects/text.c @@ -43,3 +43,204 @@ TextOutW( { return W32kTextOut(hDC, XStart, YStart, String, Count); } + +COLORREF +STDCALL +SetTextColor( + HDC hDC, + COLORREF color + ) +{ + return W32kSetTextColor(hDC, color); +} + +BOOL +STDCALL +GetTextMetricsA( + HDC hdc, + LPTEXTMETRIC tm + ) +{ + return W32kGetTextMetrics(hdc, tm); +} + +BOOL +STDCALL +GetTextMetricsW( + HDC hdc, + LPTEXTMETRIC tm + ) +{ + return W32kGetTextMetrics(hdc, tm); +} + +BOOL +APIENTRY +GetTextExtentPointA( + HDC hDC, + LPCSTR String, + int Count, + LPSIZE Size + ) +{ + ANSI_STRING StringA; + UNICODE_STRING StringU; + BOOL ret; + + RtlInitAnsiString(&StringA, (LPSTR)String); + RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE); + + ret = GetTextExtentPointW(hDC, StringU.Buffer, Count, Size); + + RtlFreeUnicodeString(&StringU); + + return ret; +} + +BOOL +APIENTRY +GetTextExtentPointW( + HDC hDC, + LPCWSTR String, + int Count, + LPSIZE Size + ) +{ + return W32kGetTextExtentPoint(hDC, String, Count, Size); +} + +BOOL +STDCALL +ExtTextOutA( + HDC hDC, + int X, + int Y, + UINT Options, + CONST RECT *Rect, + LPCSTR String, + UINT Count, + CONST INT *Spacings + ) +{ + ANSI_STRING StringA; + UNICODE_STRING StringU; + BOOL ret; + + RtlInitAnsiString(&StringA, (LPSTR)String); + RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE); + + ret = ExtTextOutW(hDC, X, Y, Options, Rect, StringU.Buffer, Count, Spacings); + + RtlFreeUnicodeString(&StringU); + + return ret; +} + +BOOL +STDCALL +ExtTextOutW( + HDC hDC, + int X, + int Y, + UINT Options, + CONST RECT *Rect, + LPCWSTR String, + UINT Count, + CONST INT *Spacings + ) +{ + return W32kTextOut(hDC, X, Y, String, Count); +} + +HFONT +STDCALL +CreateFontIndirectA( + CONST LOGFONT *lf + ) +{ + ANSI_STRING StringA; + UNICODE_STRING StringU; + BOOL ret; + LOGFONT tlf; + + RtlInitAnsiString(&StringA, (LPSTR)lf->lfFaceName); + RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE); + memcpy(&tlf, lf, sizeof(LOGFONT)); + memcpy(&tlf.lfFaceName, &StringU.Buffer, StringU.Length); + + ret = CreateFontIndirectW(&lf); + + RtlFreeUnicodeString(&StringU); + + return ret; +} + +HFONT +STDCALL +CreateFontIndirectW( + CONST LOGFONT *lf + ) +{ + return W32kCreateFontIndirect(lf); +} + +HFONT +STDCALL +CreateFontA( + int Height, + int Width, + int Escapement, + int Orientation, + int Weight, + DWORD Italic, + DWORD Underline, + DWORD StrikeOut, + DWORD CharSet, + DWORD OutputPrecision, + DWORD ClipPrecision, + DWORD Quality, + DWORD PitchAndFamily, + LPCSTR Face + ) +{ + ANSI_STRING StringA; + UNICODE_STRING StringU; + BOOL ret; + LOGFONT tlf; + + RtlInitAnsiString(&StringA, (LPSTR)Face); + RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE); + + ret = CreateFontW(Height, Width, Escapement, Orientation, Weight, Italic, Underline, StrikeOut, + CharSet, OutputPrecision, ClipPrecision, Quality, PitchAndFamily, StringU.Buffer); + + RtlFreeUnicodeString(&StringU); + + return ret; + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; +} + +HFONT +STDCALL +CreateFontW( + int Height, + int Width, + int Escapement, + int Orientation, + int Weight, + DWORD Italic, + DWORD Underline, + DWORD StrikeOut, + DWORD CharSet, + DWORD OutputPrecision, + DWORD ClipPrecision, + DWORD Quality, + DWORD PitchAndFamily, + LPCWSTR Face + ) +{ + return W32kCreateFont(Height, Width, Escapement, Orientation, Weight, Italic, Underline, StrikeOut, + CharSet, OutputPrecision, ClipPrecision, Quality, PitchAndFamily, Face); +}