Ignore:
Timestamp:
Oct 21, 1999, 12:36:54 AM (26 years ago)
Author:
sandervl
Message:

EB's EnumFontFamiliesA/W implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/gdi32.cpp

    r1254 r1388  
    1 /* $Id: gdi32.cpp,v 1.10 1999-10-11 20:55:49 sandervl Exp $ */
     1/* $Id: gdi32.cpp,v 1.11 1999-10-20 22:36:53 sandervl Exp $ */
    22
    33/*
    4  * GDI32 DIB sections
     4 * GDI32 apis
    55 *
    66 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
     
    407407//******************************************************************************
    408408//******************************************************************************
    409 HFONT WIN32API CreateFontA(int arg1, int arg2, int arg3, int arg4, int arg5,
    410                                DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9,
    411                                DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13, LPCSTR arg14)
    412 {
    413  HFONT hfont;
    414 
    415     hfont = O32_CreateFont(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14);
    416     dprintf(("GDI32: CreateFontA '%s' returned %D\n", arg14, hfont));
    417     return(hfont);
    418 }
    419 //******************************************************************************
    420 //******************************************************************************
    421409BOOL WIN32API GetDCOrgEx(HDC arg1, PPOINT arg2)
    422410{
     
    444432    dprintf(("GDI32: OS2AbortPath"));
    445433    return O32_AbortPath(arg1);
    446 }
    447 //******************************************************************************
    448 //******************************************************************************
    449 int WIN32API AddFontResourceA( LPCSTR arg1)
    450 {
    451     dprintf(("GDI32: OS2AddFontResourceA"));
    452     return O32_AddFontResource(arg1);
    453 }
    454 //******************************************************************************
    455 //******************************************************************************
    456 int WIN32API AddFontResourceW( LPCWSTR arg1)
    457 {
    458     dprintf(("GDI32: OS2AddFontResourceW STUB"));
    459     // NOTE: This will not work as is (needs UNICODE support)
    460 //    return O32_AddFontResource(arg1);
    461     return 0;
    462434}
    463435//******************************************************************************
     
    656628//******************************************************************************
    657629//******************************************************************************
    658 HFONT WIN32API CreateFontIndirectA(const LOGFONTA *lplf)
    659 {
    660  HFONT rc;
    661 
    662     dprintf(("GDI32: CreateFontIndirectA\n"));
    663     dprintf(("GDI32: lfHeight        = %d\n", lplf->lfHeight));
    664     dprintf(("GDI32: lfWidth          = %d\n", lplf->lfWidth));
    665     dprintf(("GDI32: lfEscapement    = %d\n", lplf->lfEscapement));
    666     dprintf(("GDI32: lfOrientation   = %d\n", lplf->lfOrientation));
    667     dprintf(("GDI32: lfWeight        = %d\n", lplf->lfWeight));
    668     dprintf(("GDI32: lfItalic        = %d\n", lplf->lfItalic));
    669     dprintf(("GDI32: lfUnderline     = %d\n", lplf->lfUnderline));
    670     dprintf(("GDI32: lfStrikeOut     = %d\n", lplf->lfStrikeOut));
    671     dprintf(("GDI32: lfCharSet       = %X\n", lplf->lfCharSet));
    672     dprintf(("GDI32: lfOutPrecision  = %X\n", lplf->lfOutPrecision));
    673     dprintf(("GDI32: lfClipPrecision = %X\n", lplf->lfClipPrecision));
    674     dprintf(("GDI32: lfQuality       = %X\n", lplf->lfQuality));
    675     dprintf(("GDI32: lfPitchAndFamily= %X\n", lplf->lfPitchAndFamily));
    676     dprintf(("GDI32: lfFaceName      = %s\n", lplf->lfFaceName));
    677     rc = O32_CreateFontIndirect(lplf);
    678     dprintf(("GDI32: OS2CreateFontIndirectA returned %X\n", rc));
    679     return(rc);
    680 }
    681 //******************************************************************************
    682 //******************************************************************************
    683 HFONT WIN32API CreateFontIndirectW(const LOGFONTW *lplf)
    684 {
    685  LOGFONTA afont;
    686  HFONT    hfont;
    687 
    688     memcpy(&afont, lplf, ((int)&afont.lfFaceName - (int)&afont));
    689     UnicodeToAscii((WCHAR *)lplf->lfFaceName, afont.lfFaceName);
    690 
    691     hfont = O32_CreateFontIndirect(&afont);
    692     dprintf(("GDI32: CreateFontIndirectW\n"));
    693     dprintf(("GDI32: lfHeight        = %d\n", lplf->lfHeight));
    694     dprintf(("GDI32: lfWidth          = %d\n", lplf->lfWidth));
    695     dprintf(("GDI32: lfHeight        = %d\n", afont.lfHeight));
    696     dprintf(("GDI32: lfWidth          = %d\n", afont.lfWidth));
    697     dprintf(("GDI32: lfEscapement    = %d\n", afont.lfEscapement));
    698     dprintf(("GDI32: lfOrientation   = %d\n", afont.lfOrientation));
    699     dprintf(("GDI32: lfWeight        = %d\n", afont.lfWeight));
    700     dprintf(("GDI32: lfItalic        = %d\n", afont.lfItalic));
    701     dprintf(("GDI32: lfUnderline     = %d\n", afont.lfUnderline));
    702     dprintf(("GDI32: lfStrikeOut     = %d\n", afont.lfStrikeOut));
    703     dprintf(("GDI32: lfCharSet       = %X\n", afont.lfCharSet));
    704     dprintf(("GDI32: lfOutPrecision  = %X\n", afont.lfOutPrecision));
    705     dprintf(("GDI32: lfClipPrecision = %X\n", afont.lfClipPrecision));
    706     dprintf(("GDI32: lfQuality       = %X\n", afont.lfQuality));
    707     dprintf(("GDI32: lfPitchAndFamily= %X\n", afont.lfPitchAndFamily));
    708     dprintf(("GDI32: lfFaceName      = %s\n", afont.lfFaceName));
    709     dprintf(("GDI32: CreateFontIndirectW %s returned %X\n", afont.lfFaceName, hfont));
    710 
    711     return(hfont);
    712 }
    713 //******************************************************************************
    714 //******************************************************************************
    715 HFONT WIN32API CreateFontW(int arg1, int arg2, int arg3, int arg4, int arg5,
    716                               DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9,
    717                               DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13, LPCWSTR arg14)
    718 {
    719  char *astring = UnicodeToAsciiString((LPWSTR)arg14);
    720  HFONT rc;
    721 
    722    dprintf(("GDI32: OS2CreateFontW\n"));
    723    rc = O32_CreateFont(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, astring);
    724    FreeAsciiString(astring);
    725    return(rc);
    726 }
    727630//******************************************************************************
    728631//******************************************************************************
     
    854757//******************************************************************************
    855758//******************************************************************************
    856 int WIN32API EnumFontFamiliesA(HDC          arg1,
    857                                   LPCSTR       arg2,
    858                                   FONTENUMPROCA arg3,
    859                                   LPARAM       arg4)
    860 {
    861     dprintf(("GDI32: OS2EnumFontFamiliesA DOESN'T WORK!"));
    862 //    return O32_EnumFontFamilies(arg1, arg2, arg3, arg4);
    863     return 0;
    864 }
    865 //******************************************************************************
    866 //******************************************************************************
    867 int WIN32API EnumFontFamiliesW(HDC          arg1,
    868                                LPCWSTR       arg2,
    869                                FONTENUMPROCW arg3,
    870                                LPARAM       arg4)
    871 {
    872   dprintf(("GDI32: OS2EnumFontFamiliesW not implemented\n"));
    873 
    874   // NOTE: This will not work as is (needs UNICODE support)
    875 
    876   /* @@@PH 98/06/07 EnumFontFamilies will crash upon return from a
    877                     wide-character FONTENUMPROC. */
    878   return(0);
    879 }
    880 //******************************************************************************
    881 //******************************************************************************
    882759BOOL WIN32API LineTo( HDC arg1, int arg2, int  arg3)
    883760{
     
    918795//******************************************************************************
    919796//TODO: Callback
    920 //******************************************************************************
    921 int WIN32API EnumFontsA( HDC arg1, LPCSTR arg2, FONTENUMPROCA arg3, LPARAM  arg4)
    922 {
    923     dprintf(("GDI32: OS2EnumFontsA"));
    924 //    return O32_EnumFonts(arg1, arg2, arg3, arg4);
    925     return 1;
    926 }
    927 //******************************************************************************
    928 //TODO: Callback
    929 //******************************************************************************
    930 int WIN32API EnumFontsW( HDC arg1, LPCWSTR arg2, FONTENUMPROCW arg3, LPARAM  arg4)
    931 {
    932     dprintf(("GDI32: OS2EnumFontsW - stub (1)"));
    933     // NOTE: This will not work as is (needs UNICODE support)
    934 //    return O32_EnumFonts(arg1, arg2, arg3, arg4);
    935     return 1;
    936 }
    937 //******************************************************************************
    938797//******************************************************************************
    939798BOOL WIN32API EnumMetaFile( HDC arg1, HMETAFILE arg2, MFENUMPROC arg3, LPARAM  arg4)
     
    17721631//******************************************************************************
    17731632//******************************************************************************
    1774 BOOL WIN32API RemoveFontResourceA( LPCSTR arg1)
    1775 {
    1776     dprintf(("GDI32: OS2RemoveFontResourceA %s\n", arg1));
    1777     return O32_RemoveFontResource(arg1);
    1778 }
    1779 //******************************************************************************
    1780 //******************************************************************************
    1781 BOOL WIN32API RemoveFontResourceW(LPCWSTR arg1)
    1782 {
    1783  char *astring = UnicodeToAsciiString((LPWSTR)arg1);
    1784  BOOL  rc;
    1785 
    1786     dprintf(("GDI32: OS2RemoveFontResourceW\n"));
    1787     rc = O32_RemoveFontResource(astring);
    1788     FreeAsciiString(astring);
    1789     return(rc);
    1790 }
    1791 //******************************************************************************
    1792 //******************************************************************************
    17931633HDC WIN32API ResetDCA( HDC arg1, const DEVMODEA *  arg2)
    17941634{
     
    22302070//******************************************************************************
    22312071//******************************************************************************
    2232 INT WIN32API EnumFontFamiliesExA( HDC arg1, LPLOGFONTA arg2, FONTENUMPROCEXA arg3, LPARAM  arg4, DWORD dwFlags)
    2233 {
    2234     dprintf(("GDI32: OS2EnumFontFamiliesExA, not implemented\n"));
    2235     return 0;
    2236 }
    2237 //******************************************************************************
    2238 //******************************************************************************
    2239 INT WIN32API EnumFontFamiliesExW( HDC arg1, LPLOGFONTW arg2, FONTENUMPROCEXW arg3, LPARAM  arg4, DWORD dwFlags)
    2240 {
    2241     dprintf(("GDI32: OS2EnumFontFamiliesW, not implemented\n"));
    2242     // NOTE: This will not work as is (needs UNICODE support)
    2243     return 0;
    2244 }
    2245 //******************************************************************************
    2246 //******************************************************************************
    22472072HPALETTE WIN32API CreateHalftonePalette(HDC hdc)
    22482073{
     
    23632188
    23642189//******************************************************************************
    2365 DWORD WIN32API GetFontData(HDC hdc, DWORD dwTable, DWORD dwOffset, LPVOID lpvBuffer,
    2366                               DWORD dbData)
    2367 {
    2368   dprintf(("GDI32: GetFontData, not implemented (GDI_ERROR)\n"));
    2369   return(GDI_ERROR);
    2370 }
    2371 //******************************************************************************
    2372 //******************************************************************************
    23732190int WIN32API DescribePixelFormat(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR)
    23742191{
    2375   dprintf(("GDI32: GetFontData, not implemented (GDI_ERROR)\n"));
     2192  dprintf(("GDI32: DescribePixelFormat, not implemented (GDI_ERROR)\n"));
    23762193  return(GDI_ERROR);
    23772194}
     
    27142531
    27152532
    2716 /*****************************************************************************
    2717  * Name      : BOOL CreateScalableFontResourceA
    2718  * Purpose   : The CreateScalableFontResourceA function creates a font resource
    2719  *             file for a scalable font.
    2720  * Parameters: DWORD   fdwHidden       flag for read-only embedded font
    2721  *             LPCSTR lpszFontRes     address of filename for font resource
    2722  *             LPCSTR lpszFontFile    address of filename for scalable font
    2723  *             LPCSTR lpszCurrentPath address of path to font file
    2724  * Variables :
    2725  * Result    : TRUE / FALSE
    2726  * Remark    :
    2727  * Status    : UNTESTED STUB
    2728  *
    2729  * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
    2730  *****************************************************************************/
    2731 
    2732 BOOL WIN32API CreateScalableFontResourceA(DWORD   fdwHidden,
    2733                                              LPCSTR lpszFontRes,
    2734                                              LPCSTR lpszFontFile,
    2735                                              LPCSTR lpszCurrentPath)
    2736 {
    2737   dprintf(("GDI32: CreateScalableFontResourceA(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
    2738            fdwHidden,
    2739            lpszFontRes,
    2740            lpszFontFile,
    2741            lpszCurrentPath));
    2742 
    2743   return (FALSE);
    2744 }
    2745 
    2746 
    2747 /*****************************************************************************
    2748  * Name      : BOOL CreateScalableFontResourceW
    2749  * Purpose   : The CreateScalableFontResourceW function creates a font resource
    2750  *             file for a scalable font.
    2751  * Parameters: DWORD   fdwHidden       flag for read-only embedded font
    2752  *             LPCSTR lpszFontRes     address of filename for font resource
    2753  *             LPCSTR lpszFontFile    address of filename for scalable font
    2754  *             LPCSTR lpszCurrentPath address of path to font file
    2755  * Variables :
    2756  * Result    : TRUE / FALSE
    2757  * Remark    :
    2758  * Status    : UNTESTED STUB
    2759  *
    2760  * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
    2761  *****************************************************************************/
    2762 
    2763 BOOL WIN32API CreateScalableFontResourceW(DWORD   fdwHidden,
    2764                                              LPCWSTR lpszFontRes,
    2765                                              LPCWSTR lpszFontFile,
    2766                                              LPCWSTR lpszCurrentPath)
    2767 {
    2768   dprintf(("GDI32: CreateScalableFontResourceW(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
    2769            fdwHidden,
    2770            lpszFontRes,
    2771            lpszFontFile,
    2772            lpszCurrentPath));
    2773 
    2774   return (FALSE);
    2775 }
    27762533
    27772534
     
    30172774
    30182775
    3019 /*****************************************************************************
    3020  * Name      : DWORD GetFontLanguageInfo
    3021  * Purpose   : The GetFontLanguageInfo function returns information about the
    3022  *             currently selected font for the specified display context.
    3023  *             Applications typically use this information and the
    3024  *             GetCharacterPlacement function to prepare a character string for display.
    3025  * Parameters: HDC     hdc        handle to device context
    3026  * Variables :
    3027  * Result    :
    3028  * Remark    :
    3029  * Status    : UNTESTED STUB
    3030  *
    3031  * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
    3032  *****************************************************************************/
    3033 
    3034 DWORD WIN32API GetFontLanguageInfo(HDC hdc)
    3035 {
    3036   dprintf(("GDI32: GetFontLanguageInfo(%08xh) not implemented.\n",
    3037            hdc));
    3038 
    3039   return (0);
    3040 }
    30412776
    30422777
Note: See TracChangeset for help on using the changeset viewer.