fixed declaration for W32kEnumFontFamiliesEx.

Added RosRtlLogFontA2W and RosRtlLogFontW2A to lib/rosrtl
more destubbing in gdi32/misc/stubsa/w.c

svn path=/trunk/; revision=5205
This commit is contained in:
Royce Mitchell III 2003-07-21 04:56:32 +00:00
parent d0202ddfa2
commit ce107e0415
7 changed files with 243 additions and 63 deletions

View file

@ -0,0 +1,19 @@
/* logfont.h
*/
#ifdef __cplusplus
extern "C"
{
#endif
void
RosRtlLogFontA2W ( LPLOGFONTW pW, const LPLOGFONTA pA );
void
RosRtlLogFontW2A ( LPLOGFONTA pA, const LPLOGFONTW pW );
#ifdef __cplusplus
}
#endif
/* EOF */

View file

@ -63,7 +63,7 @@ int
STDCALL STDCALL
W32kEnumFontFamiliesEx(HDC hDC, W32kEnumFontFamiliesEx(HDC hDC,
LPLOGFONTW Logfont, LPLOGFONTW Logfont,
FONTENUMPROC EnumFontFamExProc, FONTENUMEXPROC EnumFontFamExProc,
LPARAM lParam, LPARAM lParam,
DWORD Flags); DWORD Flags);

View file

@ -1,4 +1,4 @@
/* $Id: stubsa.c,v 1.13 2003/07/21 02:36:00 royce Exp $ /* $Id: stubsa.c,v 1.14 2003/07/21 04:56:31 royce Exp $
* *
* reactos/lib/gdi32/misc/stubs.c * reactos/lib/gdi32/misc/stubs.c
* *
@ -145,16 +145,31 @@ CreateICA(
/* /*
* @unimplemented * @implemented
*/ */
HDC HDC
STDCALL STDCALL
CreateMetaFileA( CreateMetaFileA(
LPCSTR a0 LPCSTR lpszFile
) )
{ {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); HDC rc;
return 0; NTSTATUS Status;
UNICODE_STRING File;
Status = RtlCreateUnicodeStringFromAsciiz ( &File,
(PCSZ)lpszFile );
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError(Status));
return 0;
}
rc = W32kCreateMetaFile ( File.Buffer );
RtlFreeUnicodeString ( &File );
return rc;
} }
@ -164,14 +179,50 @@ CreateMetaFileA(
BOOL BOOL
STDCALL STDCALL
CreateScalableFontResourceA( CreateScalableFontResourceA(
DWORD a0, DWORD fdwHidden,
LPCSTR a1, LPCSTR lpszFontRes,
LPCSTR a2, LPCSTR lpszFontFile,
LPCSTR a3 LPCSTR lpszCurrentPath
) )
{ {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); NTSTATUS Status;
return FALSE; UNICODE_STRING FontRes, FontFile, CurrentPath;
BOOL rc;
Status = RtlCreateUnicodeStringFromAsciiz ( &FontRes,
(PCSZ)lpszFontRes );
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError(Status));
return 0;
}
Status = RtlCreateUnicodeStringFromAsciiz ( &FontFile,
(PCSZ)lpszFontFile );
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError(Status));
return 0;
}
Status = RtlCreateUnicodeStringFromAsciiz ( &CurrentPath,
(PCSZ)lpszCurrentPath );
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError(Status));
return 0;
}
return W32kCreateScalableFontResource ( fdwHidden,
FontRes.Buffer,
FontFile.Buffer,
CurrentPath.Buffer );
RtlFreeUnicodeString ( &FontRes );
RtlFreeUnicodeString ( &FontFile );
RtlFreeUnicodeString ( &CurrentPath );
return rc;
} }
@ -181,15 +232,62 @@ CreateScalableFontResourceA(
int int
STDCALL STDCALL
DeviceCapabilitiesExA( DeviceCapabilitiesExA(
LPCSTR a0, LPCSTR pDevice,
LPCSTR a1, LPCSTR pPort,
WORD a2, WORD fwCapability,
LPSTR a3, LPSTR pOutput,
CONST DEVMODEA *a4 CONST DEVMODEA *pDevMode
) )
{ {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); #if 0
return 0; NTSTATUS Status;
UNICODE_STRING Device, Port, Output;
DEVMODEW DevModeW;
int rc;
Status = RtlCreateUnicodeStringFromAsciiz ( &Device,
(PCSZ)pDevice );
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError(Status));
return 0;
}
Status = RtlCreateUnicodeStringFromAsciiz ( &Port,
(PCSZ)pPort );
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError(Status));
return 0;
}
Status = RtlCreateUnicodeStringFromAsciiz ( &Output,
(PCSZ)pOutput );
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError(Status));
return 0;
}
if ( pDevMode )
RosRtlDevModeA2W ( &DevModeW, (const LPDEVMODEA)pDevMode );
/* FIXME no W32kDeviceCapabilities???? */
rc = W32kDeviceCapabilities ( Device.Buffer,
Port.Buffer,
fwCapability
Output.Buffer,
pDevMode ? &DevModeW : NULL );
RtlFreeUnicodeString ( &Device );
RtlFreeUnicodeString ( &Port );
RtlFreeUnicodeString ( &Output );
return rc;
#else
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
#endif
} }
@ -199,11 +297,11 @@ DeviceCapabilitiesExA(
int int
STDCALL STDCALL
EnumFontFamiliesExA( EnumFontFamiliesExA(
HDC a0, HDC hdc,
LPLOGFONT a1, LPLOGFONT lpLogFont,
FONTENUMEXPROC a2, FONTENUMEXPROC lpEnumFontFamProc,
LPARAM a3, LPARAM lParam,
DWORD a4 DWORD dwFlags
) )
{ {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
@ -217,10 +315,10 @@ EnumFontFamiliesExA(
int int
STDCALL STDCALL
EnumFontFamiliesA( EnumFontFamiliesA(
HDC a0, HDC hdc,
LPCSTR a1, LPCSTR lpszFamily,
FONTENUMPROC a2, FONTENUMPROC lpEnumFontFamProc,
LPARAM a3 LPARAM lParam
) )
{ {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); SetLastError(ERROR_CALL_NOT_IMPLEMENTED);

View file

@ -1,4 +1,4 @@
/* $Id: stubsw.c,v 1.13 2003/07/21 04:10:41 royce Exp $ /* $Id: stubsw.c,v 1.14 2003/07/21 04:56:32 royce Exp $
* *
* reactos/lib/gdi32/misc/stubs.c * reactos/lib/gdi32/misc/stubs.c
* *
@ -70,33 +70,34 @@ CreateICW(
/* /*
* @unimplemented * @implemented
*/ */
HDC HDC
STDCALL STDCALL
CreateMetaFileW( CreateMetaFileW(
LPCWSTR a0 LPCWSTR lpszFile
) )
{ {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return W32kCreateMetaFile ( lpszFile );
return 0;
} }
/* /*
* @unimplemented * @implemented
*/ */
BOOL BOOL
STDCALL STDCALL
CreateScalableFontResourceW( CreateScalableFontResourceW(
DWORD a0, DWORD fdwHidden,
LPCWSTR a1, LPCWSTR lpszFontRes,
LPCWSTR a2, LPCWSTR lpszFontFile,
LPCWSTR a3 LPCWSTR lpszCurrentPath
) )
{ {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return W32kCreateScalableFontResource ( fdwHidden,
return FALSE; lpszFontRes,
lpszFontFile,
lpszCurrentPath );
} }
@ -106,50 +107,57 @@ CreateScalableFontResourceW(
int int
STDCALL STDCALL
DeviceCapabilitiesExW( DeviceCapabilitiesExW(
LPCWSTR a0, LPCWSTR pDevice,
LPCWSTR a1, LPCWSTR pPort,
WORD a2, WORD fwCapability,
LPWSTR a3, LPWSTR pOutput,
CONST DEVMODEW *a4 CONST DEVMODEW *pDevMode
) )
{ {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); #if 0
return 0; /* FIXME no W32kDeviceCapabilities???? */
return W32kDeviceCapabilities ( pDevice,
pPort,
fwCapability,
pOutput,
pDevMode );
#else
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
#endif
} }
/* /*
* @unimplemented * @implemented
*/ */
int int
STDCALL STDCALL
EnumFontFamiliesExW( EnumFontFamiliesExW(
HDC a0, HDC hdc,
LPLOGFONT a1, LPLOGFONT lpLogFont,
FONTENUMEXPROC a2, FONTENUMEXPROC lpEnumFontFamProc,
LPARAM a3, LPARAM lParam,
DWORD a4 DWORD dwFlags
) )
{ {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return W32kEnumFontFamiliesEx ( hdc, lpLogFont, lpEnumFontFamProc, lParam, dwFlags );
return 0;
} }
/* /*
* @unimplemented * @implemented
*/ */
int int
STDCALL STDCALL
EnumFontFamiliesW( EnumFontFamiliesW(
HDC a0, HDC hdc,
LPCWSTR a1, LPCWSTR lpszFamily,
FONTENUMPROC a2, FONTENUMPROC lpEnumFontFamProc,
LPARAM a3 LPARAM lParam
) )
{ {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return W32kEnumFontFamilies ( hdc, lpszFamily, lpEnumFontFamProc, lParam );
return 0;
} }

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.6 2003/07/21 03:56:27 royce Exp $ # $Id: makefile,v 1.7 2003/07/21 04:56:32 royce Exp $
PATH_TO_TOP = ../.. PATH_TO_TOP = ../..
@ -17,6 +17,7 @@ THREAD_OBJECTS = \
MISC_OBJECTS = \ MISC_OBJECTS = \
misc/devmode.o \ misc/devmode.o \
misc/logfont.o \
misc/qsort.o misc/qsort.o
TARGET_OBJECTS = $(THREAD_OBJECTS) $(MISC_OBJECTS) TARGET_OBJECTS = $(THREAD_OBJECTS) $(MISC_OBJECTS)

View file

@ -1,5 +1,6 @@
#include <windows.h> #include <windows.h>
#include <string.h> #include <string.h>
#include <rosrtl/devmode.h>
void void
RosRtlDevModeA2W ( LPDEVMODEW pW, const LPDEVMODEA pA ) RosRtlDevModeA2W ( LPDEVMODEW pW, const LPDEVMODEA pA )

View file

@ -0,0 +1,53 @@
#include <windows.h>
#include <string.h>
#include <rosrtl/logfont.h>
void
RosRtlLogFontA2W ( LPLOGFONTW pW, const LPLOGFONTA pA )
{
#define COPYS(f,len) MultiByteToWideChar ( CP_THREAD_ACP, 0, pA->f, len, pW->f, len )
#define COPYN(f) pW->f = pA->f
COPYN(lfHeight);
COPYN(lfWidth);
COPYN(lfEscapement);
COPYN(lfOrientation);
COPYN(lfWeight);
COPYN(lfItalic);
COPYN(lfUnderline);
COPYN(lfStrikeOut);
COPYN(lfCharSet);
COPYN(lfOutPrecision);
COPYN(lfClipPrecision);
COPYN(lfQuality);
COPYN(lfPitchAndFamily);
COPYS(lfFaceName,LF_FACESIZE);
#undef COPYN
#undef COPYS
}
void
RosRtlLogFontW2A ( LPLOGFONTA pA, const LPLOGFONTW pW )
{
#define COPYS(f,len) WideCharToMultiByte ( CP_THREAD_ACP, 0, pW->f, len, pA->f, len, NULL, NULL )
#define COPYN(f) pA->f = pW->f
COPYN(lfHeight);
COPYN(lfWidth);
COPYN(lfEscapement);
COPYN(lfOrientation);
COPYN(lfWeight);
COPYN(lfItalic);
COPYN(lfUnderline);
COPYN(lfStrikeOut);
COPYN(lfCharSet);
COPYN(lfOutPrecision);
COPYN(lfClipPrecision);
COPYN(lfQuality);
COPYN(lfPitchAndFamily);
COPYS(lfFaceName,LF_FACESIZE);
#undef COPYN
#undef COPYS
}