Pass the breakExtra value in the ExtTextOut driver call, since there
authorAlexandre Julliard <julliard@winehq.org>
Thu, 4 Mar 2004 01:42:57 +0000 (01:42 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 4 Mar 2004 01:42:57 +0000 (01:42 +0000)
is no function to retrieve it from the HDC.

16 files changed:
dlls/gdi/enhmfdrv/enhmetafiledrv.h
dlls/gdi/enhmfdrv/graphics.c
dlls/gdi/gdi_private.h
dlls/gdi/mfdrv/metafiledrv.h
dlls/gdi/mfdrv/text.c
dlls/ttydrv/graphics.c
dlls/ttydrv/ttydrv.h
dlls/ttydrv/ttydrv.spec
dlls/wineps/psdrv.h
dlls/wineps/text.c
dlls/wineps/wineps.spec
dlls/x11drv/text.c
dlls/x11drv/x11drv.h
dlls/x11drv/x11drv.spec
dlls/x11drv/xrender.c
objects/text.c

index bfac9c6307ada7f9ea7f7664e6057d16b3b177b4..14a073dfb8cf74d5b29061c5890efdc8d9f5ab97 100644 (file)
@@ -77,7 +77,7 @@ extern BOOL     EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color,
 extern INT      EMFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode );
 extern BOOL     EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y,
                                    UINT flags, const RECT *lprect, LPCWSTR str,
-                                   UINT count, const INT *lpDx );
+                                   UINT count, const INT *lpDx, INT breakExtra );
 extern BOOL     EMFDRV_FillPath( PHYSDEV dev );
 extern BOOL     EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush );
 extern BOOL     EMFDRV_FlattenPath( PHYSDEV dev );
index e88d9c94eddabea0cf2f7598e47f0b280417265c..d5f7df6c0b944a5dbce4175a68ff505964381577 100644 (file)
@@ -650,7 +650,7 @@ EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color )
  */
 BOOL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
                        const RECT *lprect, LPCWSTR str, UINT count,
-                       const INT *lpDx )
+                       const INT *lpDx, INT breakExtra )
 {
     EMREXTTEXTOUTW *pemr;
     DWORD nSize;
index 816a00fada2ee2183d9c52aa2d460a1916332153..b89d4f2e22eea141ab4d94fa63bf55aa8db90383 100644 (file)
@@ -76,7 +76,7 @@ typedef struct tagDC_FUNCS
     INT      (*pExtEscape)(PHYSDEV,INT,INT,LPCVOID,INT,LPVOID);
     BOOL     (*pExtFloodFill)(PHYSDEV,INT,INT,COLORREF,UINT);
     INT      (*pExtSelectClipRgn)(PHYSDEV,HRGN,INT);
-    BOOL     (*pExtTextOut)(PHYSDEV,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*);
+    BOOL     (*pExtTextOut)(PHYSDEV,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*,INT);
     BOOL     (*pFillPath)(PHYSDEV);
     BOOL     (*pFillRgn)(PHYSDEV,HRGN,HBRUSH);
     BOOL     (*pFlattenPath)(PHYSDEV);
index bb275521ae002286f661cc4c80918f27ef8a7143..e8cf49e22dc45cdf398bbe308fb02904d24306b5 100644 (file)
@@ -83,7 +83,7 @@ extern BOOL MFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT
 extern INT  MFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode );
 extern BOOL MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y,
                               UINT flags, const RECT *lprect, LPCWSTR str,
-                              UINT count, const INT *lpDx );
+                              UINT count, const INT *lpDx, INT breakExtra );
 extern BOOL MFDRV_FillPath( PHYSDEV dev );
 extern BOOL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush );
 extern BOOL MFDRV_FlattenPath( PHYSDEV dev );
index ae235292d27b3d769a7a7d7265b2f72e4369761b..6ddbfd9a450c15bce2c89ef8764bd06c3fb811df 100644 (file)
@@ -74,7 +74,7 @@ static BOOL MFDRV_MetaExtTextOut( PHYSDEV dev, short x, short y, UINT16 flags,
 BOOL
 MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
                   const RECT *lprect, LPCWSTR str, UINT count,
-                  const INT *lpDx )
+                  const INT *lpDx, INT breakExtra )
 {
     RECT16     rect16;
     LPINT16    lpdx16 = NULL;
index b827cad6c747b7200e5b093dce0f058031cee668..08185069238dc208c0fe901b42e21c36e0bc27f0 100644 (file)
@@ -338,7 +338,7 @@ BOOL TTYDRV_DC_StretchBlt(TTYDRV_PDEVICE *physDevDst, INT xDst, INT yDst,
  */
 BOOL TTYDRV_DC_ExtTextOut(TTYDRV_PDEVICE *physDev, INT x, INT y, UINT flags,
                          const RECT *lpRect, LPCWSTR str, UINT count,
-                         const INT *lpDx)
+                         const INT *lpDx, INT breakExtra )
 {
 #ifdef WINE_CURSES
   INT row, col;
index 7248c8e259ee10830ae466c5111f2fa445a5919d..2d9953572aceae1fd4a4aebf09615bb578d7b219 100644 (file)
@@ -76,7 +76,7 @@ extern BOOL TTYDRV_DC_BitBlt(TTYDRV_PDEVICE *physDevDst, INT xDst, INT yDst, INT
 extern BOOL TTYDRV_DC_Chord(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
 extern BOOL TTYDRV_DC_Ellipse(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom);
 extern BOOL TTYDRV_DC_ExtFloodFill(TTYDRV_PDEVICE *physDev, INT x, INT y, COLORREF color, UINT fillType);
-extern BOOL TTYDRV_DC_ExtTextOut(TTYDRV_PDEVICE *physDev, INT x, INT y, UINT flags, const RECT *lpRect, LPCWSTR str, UINT count, const INT *lpDx);
+extern BOOL TTYDRV_DC_ExtTextOut(TTYDRV_PDEVICE *physDev, INT x, INT y, UINT flags, const RECT *lpRect, LPCWSTR str, UINT count, const INT *lpDx, INT breakExtra);
 extern BOOL TTYDRV_DC_GetCharWidth(TTYDRV_PDEVICE *physDev, UINT firstChar, UINT lastChar, LPINT buffer);
 extern COLORREF TTYDRV_DC_GetPixel(TTYDRV_PDEVICE *physDev, INT x, INT y);
 
index 2eed7f88458086a5c8f2581de18e776f3056345f..10ca443c937c0a031375ed613d3d48893c7869b7 100644 (file)
@@ -7,7 +7,7 @@
 @ cdecl DeleteDC(ptr) TTYDRV_DC_DeleteDC
 @ cdecl Ellipse(ptr long long long long) TTYDRV_DC_Ellipse
 @ cdecl ExtFloodFill(ptr long long long long) TTYDRV_DC_ExtFloodFill
-@ cdecl ExtTextOut(ptr long long long ptr ptr long ptr) TTYDRV_DC_ExtTextOut
+@ cdecl ExtTextOut(ptr long long long ptr ptr long ptr long) TTYDRV_DC_ExtTextOut
 @ cdecl GetBitmapBits(long ptr long) TTYDRV_GetBitmapBits
 @ cdecl GetCharWidth(ptr long long ptr) TTYDRV_DC_GetCharWidth
 @ cdecl GetDCOrgEx(ptr ptr) TTYDRV_GetDCOrgEx
index 849fa7a0937198b56f8e857491b5f2e7b4c07c6c..205de1eba5b32b2465ffcb3f76c553b7b948f464 100644 (file)
@@ -471,7 +471,7 @@ extern INT PSDRV_EndDoc( PSDRV_PDEVICE *physDev );
 extern INT PSDRV_EndPage( PSDRV_PDEVICE *physDev );
 extern BOOL PSDRV_ExtTextOut( PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags,
                                const RECT *lprect, LPCWSTR str, UINT count,
-                               const INT *lpDx );
+                               const INT *lpDx, INT breakExtra );
 extern BOOL PSDRV_GetCharWidth( PSDRV_PDEVICE *physDev, UINT firstChar, UINT lastChar,
                                  LPINT buffer );
 extern BOOL PSDRV_GetTextExtentPoint( PSDRV_PDEVICE *physDev, LPCWSTR str, INT count,
index 3a7bd161b4226c2996aabbf78e70dce1b2f0839e..919c5d44997d6987b6542f23ff4b5e9a051da5d2 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include <string.h>
-#include "gdi.h"
+#include <stdarg.h>
+#include <math.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
 #include "psdrv.h"
-#include "wine/debug.h"
 #include "winspool.h"
+#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
 
@@ -34,7 +39,7 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags,
  */
 BOOL PSDRV_ExtTextOut( PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags,
                       const RECT *lprect, LPCWSTR str, UINT count,
-                      const INT *lpDx )
+                      const INT *lpDx, INT breakExtra )
 {
     BOOL bResult = TRUE;
     BOOL bClipped = FALSE;
@@ -96,7 +101,6 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
     POINT pt;
     INT ascent, descent;
     WORD *glyphs = NULL;
-    DC *dc = physDev->dc;
     UINT align = GetTextAlign( physDev->hdc );
     INT char_extra;
     INT *deltas = NULL;
@@ -124,13 +128,9 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
        }
     }
 
-    if(align & TA_UPDATECP) {
-       x = dc->CursPosX;
-       y = dc->CursPosY;
-    }
-
     pt.x = x;
     pt.y = y;
+    if(align & TA_UPDATECP) GetCurrentPositionEx( physDev->hdc, &pt );
     LPtoDP(physDev->hdc, &pt, 1);
     x = pt.x;
     y = pt.y;
@@ -188,8 +188,7 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
             pt.x = x + sz.cx * cosEsc;
             pt.y = y - sz.cx * sinEsc;
             DPtoLP( physDev->hdc, &pt, 1 );
-            dc->CursPosX = pt.x;
-            dc->CursPosY = pt.y;
+            MoveToEx( physDev->hdc, pt.x, pt.y, NULL );
        }
        break;
 
@@ -207,8 +206,7 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
             pt.x = x;
             pt.y = y;
             DPtoLP( physDev->hdc, &pt, 1 );
-            dc->CursPosX = pt.x;
-            dc->CursPosY = pt.y;
+            MoveToEx( physDev->hdc, pt.x, pt.y, NULL );
        }
        break;
     }
index 91003f54c83032269842d4797b1c679f8ba96f3b..d7ed42caeeb629cab11438436b2604ceb16c4073 100644 (file)
@@ -11,7 +11,7 @@
 @ cdecl EnumDeviceFonts(ptr ptr ptr long) PSDRV_EnumDeviceFonts
 @ cdecl ExtDeviceMode(ptr long ptr ptr ptr ptr ptr long) PSDRV_ExtDeviceMode
 @ cdecl ExtEscape(ptr long long ptr long ptr) PSDRV_ExtEscape
-@ cdecl ExtTextOut(ptr long long long ptr ptr long ptr) PSDRV_ExtTextOut
+@ cdecl ExtTextOut(ptr long long long ptr ptr long ptr long) PSDRV_ExtTextOut
 @ cdecl GetCharWidth(ptr long long ptr) PSDRV_GetCharWidth
 @ cdecl GetDeviceCaps(ptr long) PSDRV_GetDeviceCaps
 @ cdecl GetTextExtentPoint(ptr ptr long ptr) PSDRV_GetTextExtentPoint
index 0d48991c1af269352adb1d3ad23d104062550425..4b0fbf18fd53cb28f972ce883d57c2c04f13ae4c 100644 (file)
@@ -44,7 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(text);
 BOOL
 X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
                    const RECT *lprect, LPCWSTR wstr, UINT count,
-                   const INT *lpDx )
+                   const INT *lpDx, INT breakExtra )
 {
     int                i;
     fontObject*                pfo;
@@ -58,14 +58,11 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
     BOOL                result = TRUE;
     HRGN                saved_region = 0;
     POINT               pt;
-    DC *dc = physDev->dc;
     UINT align = GetTextAlign( physDev->hdc );
     INT charExtra = GetTextCharacterExtra( physDev->hdc );
 
-    if(dc->gdiFont)
-        return X11DRV_XRender_ExtTextOut(physDev, x, y, flags, lprect, wstr, count,
-                                        lpDx);
-
+    if(physDev->dc->gdiFont)
+        return X11DRV_XRender_ExtTextOut(physDev, x, y, flags, lprect, wstr, count, lpDx, breakExtra);
 
     if (!X11DRV_SetupGCForText( physDev )) return TRUE;
 
@@ -271,7 +268,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
     wine_tsx11_unlock();
     if(!rotated)
     {
-      if (!charExtra && !dc->breakExtra && !lpDx)
+      if (!charExtra && !breakExtra && !lpDx)
       {
         X11DRV_cptable[pfo->fi->cptable].pDrawString(
                pfo, gdi_display, physDev->drawable, physDev->gc,
@@ -293,7 +290,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
            long ve_we;
            unsigned short err = 0;
 
-           ve_we = (LONG)(dc->xformWorld2Vport.eM11 * 0x10000);
+           ve_we = (LONG)(physDev->dc->xformWorld2Vport.eM11 * 0x10000);
 
            while (i < count)
            {
@@ -338,7 +335,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
                 {
                     delta += charExtra;
                     if (str2b[i].byte2 == (char)dfBreakChar)
-                     delta += dc->breakExtra;
+                     delta += breakExtra;
                    pitem->nchars++;
                 } while ((++i < count) && !delta);
                pitem++;
@@ -381,7 +378,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
                          * pfo->lpX11Trans->pixelsize / 1000.0;
          offset += charExtra;
          if (str2b[i].byte2 == (char)dfBreakChar)
-           offset += dc->breakExtra;
+           offset += breakExtra;
        }
       }
     }
index e7d27a1db257fb57f6f68750659102bb4a387b8a..9158a43635e82408c0d3bd55a7c9a1a0361eda04 100644 (file)
@@ -169,7 +169,7 @@ extern BOOL X11DRV_ExtFloodFill( X11DRV_PDEVICE *physDev, INT x, INT y,
                                   COLORREF color, UINT fillType );
 extern BOOL X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y,
                                 UINT flags, const RECT *lprect,
-                                LPCWSTR str, UINT count, const INT *lpDx );
+                                LPCWSTR str, UINT count, const INT *lpDx, INT breakExtra );
 extern LONG X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count );
 extern void X11DRV_SetDeviceClipping( X11DRV_PDEVICE *physDev, HRGN vis_rgn, HRGN clip_rgn );
 extern INT X11DRV_SetDIBitsToDevice( X11DRV_PDEVICE *physDev, INT xDest,
@@ -231,7 +231,7 @@ extern BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE*, HFONT);
 extern void X11DRV_XRender_DeleteDC(X11DRV_PDEVICE*);
 extern BOOL X11DRV_XRender_ExtTextOut(X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
                                      const RECT *lprect, LPCWSTR wstr,
-                                     UINT count, const INT *lpDx);
+                                     UINT count, const INT *lpDx, INT breakExtra);
 extern void X11DRV_XRender_UpdateDrawable(X11DRV_PDEVICE *physDev);
 
 extern void X11DRV_OpenGL_Init(Display *display);
index fd726d162295bb6f603ae65a363a690c06fbad5c..a5ab235ac53b4ad77b83fe42e23e6083b932438d 100644 (file)
@@ -14,7 +14,7 @@
 @ cdecl EnumDeviceFonts(ptr ptr ptr long) X11DRV_EnumDeviceFonts
 @ cdecl ExtEscape(ptr long long ptr long ptr) X11DRV_ExtEscape
 @ cdecl ExtFloodFill(ptr long long long long) X11DRV_ExtFloodFill
-@ cdecl ExtTextOut(ptr long long long ptr ptr long ptr) X11DRV_ExtTextOut
+@ cdecl ExtTextOut(ptr long long long ptr ptr long ptr long) X11DRV_ExtTextOut
 @ cdecl GetBitmapBits(long ptr long) X11DRV_GetBitmapBits
 @ cdecl GetCharWidth(ptr long long ptr) X11DRV_GetCharWidth
 @ cdecl GetDCOrgEx(ptr ptr) X11DRV_GetDCOrgEx
index 941bd53b04ebe9ac09545ba65a093ce76fe4e3b6..b308047aadfb774c4068a351a4f6377888d5cedf 100644 (file)
@@ -930,7 +930,7 @@ static int XRenderErrorHandler(Display *dpy, XErrorEvent *event, void *arg)
  */
 BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
                                const RECT *lprect, LPCWSTR wstr, UINT count,
-                               const INT *lpDx )
+                               const INT *lpDx, INT breakExtra )
 {
     XRenderColor col;
     int idx;
@@ -1514,7 +1514,7 @@ void X11DRV_XRender_DeleteDC(X11DRV_PDEVICE *physDev)
 
 BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
                                const RECT *lprect, LPCWSTR wstr, UINT count,
-                               const INT *lpDx )
+                               const INT *lpDx, INT breakExtra )
 {
   assert(0);
   return FALSE;
index 7bc4e42fba6ea931fc61f6684fa6ba6e073568bc..b3d863e278a59b9712db3a0a725db6eac378f843 100644 (file)
@@ -166,10 +166,11 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
                               lpReorderedString, count, NULL );
 
                 ret = dc->funcs->pExtTextOut(dc->physDev,x,y,flags|ETO_IGNORELANGUAGE,
-                                             lprect,lpReorderedString,count,lpDx);
+                                             lprect,lpReorderedString,count,lpDx,dc->breakExtra);
                 HeapFree(GetProcessHeap(), 0, lpReorderedString);
             } else
-                ret = dc->funcs->pExtTextOut(dc->physDev,x,y,flags,lprect,str,count,lpDx);
+                ret = dc->funcs->pExtTextOut(dc->physDev,x,y,flags,lprect,str,count,
+                                             lpDx,dc->breakExtra);
         }
         GDI_ReleaseObj( hdc );
     }