Author: greatlrd Date: Sun Mar 9 16:36:09 2008 New Revision: 32631
URL: http://svn.reactos.org/svn/reactos?rev=3D32631&view=3Drev Log: partly implement gdi32 Escape implemented command GETSCALINGFACTOR Escape change from if to switch statment for it is faster and cleaner =
Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c
Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/= stubs.c?rev=3D32631&r1=3D32630&r2=3D32631&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Sun Mar 9 16:36:09 2008 @@ -1502,35 +1502,54 @@ STDCALL Escape(HDC hdc, INT nEscape, INT cbInput, LPCSTR lpvInData, LPVOID lpvOutD= ata) { - int retValue =3D -1; - - /* FIXME gdi share memory */ - - if (nEscape =3D=3D GETCOLORTABLE) + int retValue =3D -1; =
+ HGDIOBJ hObject =3D hdc; + UINT Type =3D 0; + + Type =3D GDI_HANDLE_GET_TYPE(hObject); + + if (Type =3D=3D GDI_OBJECT_TYPE_METADC) { - retValue =3D GetSystemPaletteEntries(hdc, (UINT)*lpvInData, 1, (LP= PALETTEENTRY)lpvOutData); - if ( !retValue ) + /* FIXME we do not support metafile */ + UNIMPLEMENTED; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + } + else + { + switch (nEscape) { - retValue =3D -1; =
+ case GETCOLORTABLE: =
+ retValue =3D GetSystemPaletteEntries(hdc, (UINT)*lpvInData= , 1, (LPPALETTEENTRY)lpvOutData); + if ( !retValue ) + { + retValue =3D -1; =
+ } =
+ break; + + case GETEXTENDEDTEXTMETRICS: + retValue =3D (int) GetETM( hdc, (EXTTEXTMETRIC *) lpvOutDa= ta) !=3D 0; + break; + =
+ case GETSCALINGFACTOR: =
+ /* Note GETSCALINGFACTOR is outdated have been replace by = GetDeviceCaps */ + if ( Type =3D=3D GDI_OBJECT_TYPE_DC ) + { =
+ if ( lpvOutData ) + { + PPOINT ptr =3D (PPOINT) lpvOutData; + ptr->x =3D 0; + ptr->y =3D 0; =
+ } + } =
+ retValue =3D 0; + break; + + default: + UNIMPLEMENTED; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); =
} - - /* FIXME tempary until Escape are completed */ - return retValue; } - else if (nEscape =3D=3D GETEXTENDEDTEXTMETRICS) - { - retValue =3D (int) GetETM( hdc, (EXTTEXTMETRIC *) lpvOutData) !=3D= 0; - - /* FIXME tempary until Escape are completed */ - return retValue; - } - else if ( nEscape !=3D QUERYESCSUPPORT ) - { =
- } - - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return retValue; } =