[ros-diffs] [jimtabor] 44932: - Sorry I thought I turn the debug off.region.c

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Mon Jan 4 21:44:48 CET 2010


Author: jimtabor
Date: Mon Jan  4 21:44:48 2010
New Revision: 44932

URL: http://svn.reactos.org/svn/reactos?rev=44932&view=rev
Log:
- Sorry I thought I turn the debug off.region.c

Modified:
    trunk/reactos/subsystems/win32/win32k/objects/font.c
    trunk/reactos/subsystems/win32/win32k/objects/region.c

Modified: trunk/reactos/subsystems/win32/win32k/objects/font.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/font.c?rev=44932&r1=44931&r2=44932&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/font.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/font.c [iso-8859-1] Mon Jan  4 21:44:48 2010
@@ -75,7 +75,19 @@
   return Count;
 }
 
-
+/*
+
+  It is recommended that an application use the GetFontLanguageInfo function
+  to determine whether the GCP_DIACRITIC, GCP_DBCS, GCP_USEKERNING, GCP_LIGATE,
+  GCP_REORDER, GCP_GLYPHSHAPE, and GCP_KASHIDA values are valid for the
+  currently selected font. If not valid, GetCharacterPlacement ignores the
+  value.
+
+  M$ must use a preset "compiled in" support for each language based releases.
+  ReactOS uses FreeType, this will need to be supported. ATM this is hard coded
+  for GCPCLASS_LATIN!
+
+ */
 DWORD
 FASTCALL
 GreGetCharacterPlacementW(
@@ -86,7 +98,14 @@
     LPGCP_RESULTSW pgcpw,
     DWORD dwFlags)
 {
+  GCP_RESULTSW gcpwSave;
+  UINT i, nSet, cSet;
+//  INT *lpDx, *tmpDxCaretPos;
+  INT *tmpDxCaretPos;
+  LONG Cx;
   SIZE Size = {0,0};
+
+  DPRINT1("GreGCPW Start\n");
 
   if (!pgcpw)
   {
@@ -94,8 +113,170 @@
         return MAKELONG(Size.cx, Size.cy);
      return 0;
   }
-  UNIMPLEMENTED;
-  return 0;
+
+  RtlCopyMemory(&gcpwSave, pgcpw, sizeof(GCP_RESULTSW));
+
+  cSet = nSet = nCount;
+
+  if ( nCount > gcpwSave.nGlyphs ) cSet = gcpwSave.nGlyphs;
+
+  /* GCP_JUSTIFY may only be used in conjunction with GCP_MAXEXTENT. */
+  if ( dwFlags & GCP_JUSTIFY) dwFlags |= GCP_MAXEXTENT;
+
+  if ( !gcpwSave.lpDx && gcpwSave.lpCaretPos )
+     tmpDxCaretPos = gcpwSave.lpCaretPos;
+  else
+     tmpDxCaretPos = gcpwSave.lpDx;  
+
+  if ( !GreGetTextExtentExW( hdc,
+                             pwsz,
+                             cSet,
+                             nMaxExtent,
+                            ((dwFlags & GCP_MAXEXTENT) ? (PULONG) &cSet : NULL),
+                            (PULONG) tmpDxCaretPos,
+                             &Size,
+                             0) )
+  {
+     return 0;
+  }
+
+  nSet = cSet;
+
+  if ( tmpDxCaretPos && nSet > 0)
+  {
+//      lpDx = tmpDxCaretPos + 4 * nSet - 4;
+//      lpDx = tmpDxCaretPos[nSet - 1];
+/*      while ( lpDx > tmpDxCaretPos )
+      {
+          *lpDx -= *lpDx - 4;
+          lpDx -= 4;
+      }*/
+      for (i = (nSet - 1); i > 0; i--)
+      {
+          tmpDxCaretPos[i] -= tmpDxCaretPos[i - 1];
+      }
+  }
+
+  if ( !(dwFlags & GCP_MAXEXTENT) || nSet )
+  {
+     if ( (dwFlags & GCP_USEKERNING) &&
+           ( gcpwSave.lpDx ||
+             gcpwSave.lpCaretPos ) &&
+           nSet >= 2 )
+     {
+        DWORD Count;
+        LPKERNINGPAIR pKP;
+        
+        Count = GreGetKerningPairs( hdc, 0, NULL);
+        if (Count)
+        {
+           pKP = ExAllocatePoolWithTag(PagedPool, Count * sizeof(KERNINGPAIR), GDITAG_TEXT);
+           if (pKP)
+           {
+              if ( GreGetKerningPairs( hdc, Count, pKP) != Count)
+              {
+                 ExFreePoolWithTag( pKP, GDITAG_TEXT);
+                 return 0;
+              }
+
+              if ( (ULONG_PTR)(pKP) < ((ULONG_PTR)(pKP) + (ULONG_PTR)(Count * sizeof(KERNINGPAIR))) )
+              {
+                 DPRINT1("We Need to Do Something HERE!\n");
+              }
+
+              ExFreePoolWithTag( pKP, GDITAG_TEXT);
+
+              if ( dwFlags & GCP_MAXEXTENT )
+              {
+//                 Cx = Size.cx;
+                 if ( Size.cx > nMaxExtent )
+                 {
+//                    lpDx = tmpDxCaretPos + 4 * nSet - 4;
+//                    lpDx = tmpDxCaretPos[nSet - 1];
+/*
+                    while ( 1 )
+                    {
+                       if ( !nSet ) break;
+
+                       Cx -= *lpDx;
+                       --nSet;
+                       lpDx -= 4;
+
+                       Size.cx = Cx;
+
+                       if ( Cx <= nMaxExtent ) break;
+                    }*/
+                    for (Cx = Size.cx; nSet > 0; nSet--)
+                    {
+                        Cx -= tmpDxCaretPos[nSet - 1];
+                        Size.cx = Cx;
+                        if ( Cx <= nMaxExtent ) break;
+                    }
+                 }
+                 if ( !nSet )
+                 {
+                    pgcpw->nGlyphs = 0;
+                    pgcpw->nMaxFit = 0;
+                    return 0;
+                 }
+              }
+           }
+        }
+     }
+
+     if ( (dwFlags & GCP_JUSTIFY) &&
+           ( gcpwSave.lpDx ||
+             gcpwSave.lpCaretPos ) &&
+           nSet )
+     {
+         DPRINT1("We Need to Do Something HERE 2!\n");
+     }
+
+     if ( gcpwSave.lpDx && gcpwSave.lpCaretPos )
+        RtlCopyMemory( gcpwSave.lpCaretPos, gcpwSave.lpDx, nSet * sizeof(LONG));
+
+     if ( gcpwSave.lpCaretPos )
+     {
+        int pos = 0;
+        i = 0;
+        if ( nSet > 0 )
+        {
+           do
+           {
+              Cx = gcpwSave.lpCaretPos[i];
+              gcpwSave.lpCaretPos[i] = pos;
+              pos += Cx;
+              ++i;
+           }
+           while ( i < nSet );
+        }
+     }
+
+     if ( gcpwSave.lpOutString )
+        RtlCopyMemory(gcpwSave.lpOutString, pwsz,  nSet * sizeof(WCHAR));
+
+     if ( gcpwSave.lpClass )
+        RtlFillMemory(gcpwSave.lpClass, nSet, GCPCLASS_LATIN);
+
+     if ( gcpwSave.lpOrder )
+     {
+        for (i = 0; i < nSet; i++)
+           gcpwSave.lpOrder[i] = i;
+     }
+
+     if ( gcpwSave.lpGlyphs )
+     {
+        if ( GreGetGlyphIndicesW( hdc, pwsz, nSet, gcpwSave.lpGlyphs, 0, 0) == GDI_ERROR )
+        {
+           nSet = 0;
+           Size.cx = 0;
+           Size.cy = 0;
+        }
+     }
+     pgcpw->nGlyphs = nSet;
+     pgcpw->nMaxFit = nSet;
+  }
+  return MAKELONG(Size.cx, Size.cy);
 }
 
 INT
@@ -313,8 +494,12 @@
     IN OUT LPGCP_RESULTSW pgcpw,
     IN DWORD dwFlags)
 {
-    UNIMPLEMENTED;
-    return 0;
+    return GreGetCharacterPlacementW( hdc,
+                                      pwsz,
+                                      nCount,
+                                      nMaxExtent,
+                                      pgcpw,
+                                      dwFlags);
 }
 
 DWORD

Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/region.c?rev=44932&r1=44931&r2=44932&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] Mon Jan  4 21:44:48 2010
@@ -2525,7 +2525,7 @@
     }
     else
     {
-        DPRINT1("SetRectRgn NULL Count: %d \n", rgn->rdh.nCount);
+        DPRINT("SetRectRgn NULL Count: %d \n", rgn->rdh.nCount);
         EMPTY_REGION(rgn);
     }
 }




More information about the Ros-diffs mailing list