Ignore:
Timestamp:
Aug 14, 2000, 5:51:20 PM (25 years ago)
Author:
cbratschi
Message:

activated WinDrawText

File:
1 edited

Legend:

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

    r3648 r4012  
    1 /* $Id: text.cpp,v 1.10 2000-06-01 19:00:05 sandervl Exp $ */
     1/* $Id: text.cpp,v 1.11 2000-08-14 15:51:20 cbratschi Exp $ */
    22
    33/*
     
    77 *
    88 * Copyright 1993, 1994 Alexandre Julliard
    9  * Copyright 1999 Christoph Bratschi
     9 * Copyright 1999-2000 Christoph Bratschi
    1010 *
    1111 * Project Odin Software License can be found in LICENSE.TXT
     
    1919#include "oslibgpi.h"
    2020
    21 #define DBG_LOCALLOG    DBG_text
     21#define DBG_LOCALLOG    DBG_text
    2222#include "dbglocal.h"
    2323
     
    9595INT SYSTEM EXPORT InternalDrawTextExA(HDC hdc,LPCSTR lpchText,INT cchText,LPRECT lprc,UINT dwDTFormat,LPDRAWTEXTPARAMS lpDTParams,BOOL isDrawTextEx)
    9696{
    97 /*
    98   PVOID pHps = OSLibGpiQueryDCData(hdc);
    9997  INT rc;
    10098  ULONG flCmd;
     
    102100  PRECT rectPtr;
    103101  LONG lTabs,xLeft,yTop;
    104 
    105   if ((!lpchText) || (cchText == 0) || (cchText < -1) || (!lprc == NULL))
     102  UINT fpuctrlword;
     103
     104  //SvL: Open32's DrawText messes up the fpu control word! (@#$@#$@#$)
     105  //CB: don't know if this is still the case with WinDrawTabbedText (-> testcase)
     106  fpuctrlword = _control87(0, 0);
     107
     108  if ((!lpchText) || (cchText == 0) || (cchText < -1) || (lprc == NULL))
    106109  {
    107110    SetLastError(ERROR_INVALID_PARAMETER);
    108111    return 0;
    109112  }
     113
     114  PVOID pHps = OSLibGpiQueryDCData(hdc);
    110115
    111116  if (!pHps)
     
    199204    rectPtr = &localRectangle;
    200205
    201     if (getMapMode(pHps) == MMOS_ANISOTROPIC || getMapMode(pHps) == MMOS_ISOTROPIC)
     206    if ((getMapMode(pHps) == MMOS_ANISOTROPIC) || (getMapMode(pHps) == MMOS_ISOTROPIC))
    202207    {
    203208      if (doesYAxisGrowNorth(pHps))
     
    232237    if (isDrawTextEx)
    233238    {
    234       lTabs = (lpDTParams && dwDTFormat & DT_TABSTOP) ? lpDTParams->iTabLength:8;
     239      lTabs = (lpDTParams && (dwDTFormat & DT_TABSTOP)) ? lpDTParams->iTabLength:8;
    235240    } else
    236241    {
     
    385390
    386391  if (!done)
     392  {
    387393    rc = OSLibWinDrawTabbedText(pHps,cchText,lTabs,lpchText,rectPtr,0,0,flCmd);
     394  }
    388395
    389396  if (dwDTFormat & DT_CALCRECT)
     
    408415  }
    409416
    410   return rc;
    411 */
    412   UINT fpuctrlword;
    413   INT rc;
    414 
    415   //SvL: Open32's DrawText messes up the fpu control word! (@#$@#$@#$)
    416   fpuctrlword = _control87(0, 0);
    417   dwDTFormat &= ~(DT_END_ELLIPSIS | DT_PATH_ELLIPSIS);
    418 
    419   rc = O32_DrawText(hdc,lpchText,cchText,lprc,dwDTFormat);
    420417  _control87(fpuctrlword, 0xFFFF);
     418
    421419  return rc;
    422420}
     
    576574  if (!pHps || (cbCount < 0) || ((lpszString == NULL) && (cbCount != 0)))
    577575  {
    578         dprintf(("InternalTextOutA: invalid parameter"));
    579         SetLastError(ERROR_INVALID_HANDLE);
    580         return FALSE;
     576        dprintf(("InternalTextOutA: invalid parameter"));
     577        SetLastError(ERROR_INVALID_HANDLE);
     578        return FALSE;
    581579  }
    582580
    583581  if (cbCount > 512)
    584582  {
    585         dprintf(("InternalTextOutA: invalid parameter cbCount"));
    586         SetLastError(ERROR_INVALID_PARAMETER);
    587         return FALSE;
     583        dprintf(("InternalTextOutA: invalid parameter cbCount"));
     584        SetLastError(ERROR_INVALID_PARAMETER);
     585        return FALSE;
    588586  }
    589587  if (fuOptions & ~((UINT)(ETO_CLIPPED | ETO_OPAQUE)))
    590588  {
    591         dprintf(("InternalTextOutA: invalid fuOptions"));
    592         //ETO_GLYPH_INDEX, ETO_RTLLEADING, ETO_NUMERICSLOCAL, ETO_NUMERICSLATIN, ETO_IGNORELANGUAGE, ETO_PDY  are ignored
    593         return TRUE;
     589        dprintf(("InternalTextOutA: invalid fuOptions"));
     590        //ETO_GLYPH_INDEX, ETO_RTLLEADING, ETO_NUMERICSLOCAL, ETO_NUMERICSLATIN, ETO_IGNORELANGUAGE, ETO_PDY  are ignored
     591        return TRUE;
    594592  }
    595593
     
    603601      if (excludeBottomRightPoint(pHps,(PPOINTLOS2)&pmRect) == 0)
    604602      {
    605         dprintf(("InternalTextOutA: excludeBottomRightPoint returned 0"));
     603        dprintf(("InternalTextOutA: excludeBottomRightPoint returned 0"));
    606604        return TRUE;
    607605      }
     
    610608      if (fuOptions & ETO_OPAQUE)  flOptions |= CHSOS_OPAQUE;
    611609    }
    612   } 
     610  }
    613611  else
    614612  {
    615613    if (fuOptions)
    616614    {
    617         dprintf(("InternalTextOutA: ERROR_INVALID_HANDLE"));
    618         SetLastError(ERROR_INVALID_HANDLE);
    619         return FALSE;
     615        dprintf(("InternalTextOutA: ERROR_INVALID_HANDLE"));
     616        SetLastError(ERROR_INVALID_HANDLE);
     617        return FALSE;
    620618    }
    621619  }
     
    625623    if (fuOptions & ETO_OPAQUE)
    626624    {
    627         lpszString = " ";
    628         cbCount = 1;
    629         flOptions |= CHSOS_CLIP;
    630     } 
     625        lpszString = " ";
     626        cbCount = 1;
     627        flOptions |= CHSOS_CLIP;
     628    }
    631629    else {
    632         dprintf(("InternalTextOutA: cbCount == 0"));
    633         return TRUE;
     630        dprintf(("InternalTextOutA: cbCount == 0"));
     631        return TRUE;
    634632    }
    635633  }
     
    643641
    644642    flOptions |= CHSOS_LEAVEPOS;
    645   } 
     643  }
    646644  else OSLibGpiQueryCurrentPosition(pHps,&ptl);
    647645
     
    675673
    676674  if(hits == GPIOS_ERROR) {
    677         dprintf(("InternalTextOutA: OSLibGpiCharStringPosAt returned GPIOS_ERROR"));
    678         return FALSE;
     675        dprintf(("InternalTextOutA: OSLibGpiCharStringPosAt returned GPIOS_ERROR"));
     676        return FALSE;
    679677  }
    680678
Note: See TracChangeset for help on using the changeset viewer.