From 1fe725113ba9fe39f51b8ebfa7016dbf6eddc575 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sat, 25 Aug 2007 17:12:59 +0000 Subject: [PATCH] partly implement EngComputeGlyphSet in eng.c move EngMultiByteToWideChar, EngQueryLocalTime, EngReleaseSemaphore from stub.c to eng.c start implement of EngQueryEMFInfo need bit more figout how it is done svn path=/trunk/; revision=28552 --- reactos/dll/win32/gdi32/misc/stubs.c | 74 +++++++---------------- reactos/dll/win32/gdi32/objects/eng.c | 84 +++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 54 deletions(-) diff --git a/reactos/dll/win32/gdi32/misc/stubs.c b/reactos/dll/win32/gdi32/misc/stubs.c index a8c87c69b4f..63fb3634067 100644 --- a/reactos/dll/win32/gdi32/misc/stubs.c +++ b/reactos/dll/win32/gdi32/misc/stubs.c @@ -2446,16 +2446,7 @@ CreateBitmap( } -/* - * @unimplemented - */ -FD_GLYPHSET* STDCALL -EngComputeGlyphSet(INT nCodePage,INT nFirstChar,INT cChars) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} + /* * @unimplemented @@ -2468,58 +2459,33 @@ EngGetDriverName(HDEV hdev) return 0; } - /* - * @implemented - */ -INT STDCALL -EngMultiByteToWideChar(UINT CodePage, - LPWSTR WideCharString, - INT BytesInWideCharString, - LPSTR MultiByteString, - INT BytesInMultiByteString) -{ - return MultiByteToWideChar(CodePage,0,MultiByteString,BytesInMultiByteString,WideCharString,BytesInWideCharString / sizeof(WCHAR)); -} - -/* - * @implemented - * Obsolete GDI Function - * http://www.osronline.com/DDKx/graphics/gdioview_20tj.htm + * @unimplemented + * wrong info it is not Obsolete GDI Function as http://www.osronline.com/DDKx/graphics/gdioview_20tj.htm say */ BOOL STDCALL EngQueryEMFInfo(HDEV hdev,EMFINFO *pEMFInfo) { - return FALSE; +#if 0 + BOOL retValue = FALSE; + DHPDEV Dhpdev; + + if ((!hdev) && (!pEMFInfo)) + { + if ((Dhpdev = NtGdiGetDhpdev(hdev))) + { + /* FIXME check if it support or if it is pEMFInfo we got */ + /* FIXME copy the data from Dhpdev to pEMFInfo */ + } + } + return retValue; +#else + return FALSE; +#endif } -/* - * @implemented - */ -VOID STDCALL -EngQueryLocalTime(PENG_TIME_FIELDS etf) -{ - SYSTEMTIME SystemTime; - GetLocalTime( &SystemTime ); - etf->usYear = SystemTime.wYear; - etf->usMonth = SystemTime.wMonth; - etf->usWeekday = SystemTime.wDayOfWeek; - etf->usDay = SystemTime.wDay; - etf->usHour = SystemTime.wHour; - etf->usMinute = SystemTime.wMinute; - etf->usSecond = SystemTime.wSecond; - etf->usMilliseconds = SystemTime.wMilliseconds; -} -/* - * @implemented - */ -VOID -STDCALL -EngReleaseSemaphore ( IN HSEMAPHORE hsem ) -{ - RtlLeaveCriticalSection( (PRTL_CRITICAL_SECTION) hsem); -} + /* * @implemented diff --git a/reactos/dll/win32/gdi32/objects/eng.c b/reactos/dll/win32/gdi32/objects/eng.c index e3a62dfe168..90ed4775ad0 100644 --- a/reactos/dll/win32/gdi32/objects/eng.c +++ b/reactos/dll/win32/gdi32/objects/eng.c @@ -118,4 +118,88 @@ EngLoadModule(LPWSTR pwsz) return LoadLibraryExW ( pwsz, NULL, LOAD_LIBRARY_AS_DATAFILE); } +/* + * @implemented + */ +INT STDCALL +EngMultiByteToWideChar(UINT CodePage, + LPWSTR WideCharString, + INT BytesInWideCharString, + LPSTR MultiByteString, + INT BytesInMultiByteString) +{ + return MultiByteToWideChar(CodePage,0,MultiByteString,BytesInMultiByteString,WideCharString,BytesInWideCharString / sizeof(WCHAR)); +} +/* + * @implemented + */ +VOID STDCALL +EngQueryLocalTime(PENG_TIME_FIELDS etf) +{ + SYSTEMTIME SystemTime; + GetLocalTime( &SystemTime ); + etf->usYear = SystemTime.wYear; + etf->usMonth = SystemTime.wMonth; + etf->usWeekday = SystemTime.wDayOfWeek; + etf->usDay = SystemTime.wDay; + etf->usHour = SystemTime.wHour; + etf->usMinute = SystemTime.wMinute; + etf->usSecond = SystemTime.wSecond; + etf->usMilliseconds = SystemTime.wMilliseconds; +} + +/* + * @implemented + */ +VOID +STDCALL +EngReleaseSemaphore ( IN HSEMAPHORE hsem ) +{ + RtlLeaveCriticalSection( (PRTL_CRITICAL_SECTION) hsem); +} + +BOOL +copy_my_glyphset( FD_GLYPHSET *dst_glyphset , FD_GLYPHSET * src_glyphset, ULONG Size) +{ + BOOL retValue = FALSE; + + memcpy(src_glyphset, dst_glyphset, Size); + if (src_glyphset->cRuns == 0) + { + retValue = TRUE; + } + + /* FIXME copy wrun */ + return retValue; +} + +/* + * @unimplemented + */ +FD_GLYPHSET* STDCALL +EngComputeGlyphSet(INT nCodePage,INT nFirstChar,INT cChars) +{ + FD_GLYPHSET * ntfd_glyphset; + FD_GLYPHSET * myfd_glyphset = NULL; + + ntfd_glyphset = NtGdiEngComputeGlyphSet(nCodePage,nFirstChar,cChars); + + if (!ntfd_glyphset) + { + if (ntfd_glyphset->cjThis) + { + myfd_glyphset = GlobalAlloc(0,ntfd_glyphset->cjThis); + + if (!myfd_glyphset) + { + if (copy_my_glyphset(myfd_glyphset,ntfd_glyphset,ntfd_glyphset->cjThis) == FALSE) + { + GlobalFree(myfd_glyphset); + myfd_glyphset = NULL; + } + } + } + } + return myfd_glyphset; +}