mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
2003-12-08 Casper S. Hornstrup <chorns@users.sourceforge.net>
* include/win32k/text.h (NtGdiExtTextOut): Follow ExtTextOut prototype. * lib/gdi32/objects/text.c (ExtTextOutW): Call NtGdiExtTextOut(). * lib/user32/controls/edit.c (EDIT_BuildLineDefs_ML): Order parameters to CreateRectRgn(). * lib/user32/windows/draw.c (TabbedTextOutA): Implement. (TEXT_TabbedTextOut): New function. (TabbedTextOutW): Implement. * subsys/win32k/objects/text.c (NtGdiExtTextOut): Call NtGdiTextOut() for now. svn path=/trunk/; revision=6923
This commit is contained in:
parent
bfb695a0b4
commit
61fe50f6f6
6 changed files with 147 additions and 29 deletions
|
@ -1,3 +1,15 @@
|
|||
2003-12-08 Casper S. Hornstrup <chorns@users.sourceforge.net>
|
||||
|
||||
* include/win32k/text.h (NtGdiExtTextOut): Follow ExtTextOut prototype.
|
||||
* lib/gdi32/objects/text.c (ExtTextOutW): Call NtGdiExtTextOut().
|
||||
* lib/user32/controls/edit.c (EDIT_BuildLineDefs_ML): Order parameters to
|
||||
CreateRectRgn().
|
||||
* lib/user32/windows/draw.c (TabbedTextOutA): Implement.
|
||||
(TEXT_TabbedTextOut): New function.
|
||||
(TabbedTextOutW): Implement.
|
||||
* subsys/win32k/objects/text.c (NtGdiExtTextOut): Call NtGdiTextOut() for
|
||||
now.
|
||||
|
||||
2003-12-07 Casper S. Hornstrup <chorns@users.sourceforge.net>
|
||||
|
||||
* lib/user32/windows/accel.c (U32IsValidAccelMessage): Translate WM_KEYUP
|
||||
|
|
|
@ -76,14 +76,14 @@ NtGdiEnumFonts(HDC hDC,
|
|||
|
||||
BOOL
|
||||
STDCALL
|
||||
NtGdiExtTextOut(HDC hDC,
|
||||
NtGdiExtTextOut(HDC hdc,
|
||||
int X,
|
||||
int Y,
|
||||
UINT Options,
|
||||
CONST LPRECT rc,
|
||||
LPCWSTR String,
|
||||
UINT Count,
|
||||
CONST LPINT Dx);
|
||||
UINT fuOptions,
|
||||
CONST RECT *lprc,
|
||||
LPCWSTR lpString,
|
||||
UINT cbCount,
|
||||
CONST INT *lpDx);
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
|
|
|
@ -364,17 +364,17 @@ ExtTextOutA(
|
|||
BOOL
|
||||
STDCALL
|
||||
ExtTextOutW(
|
||||
HDC hDC,
|
||||
HDC hdc,
|
||||
int X,
|
||||
int Y,
|
||||
UINT Options,
|
||||
CONST RECT *Rect,
|
||||
LPCWSTR String,
|
||||
UINT Count,
|
||||
CONST INT *Spacings
|
||||
UINT fuOptions,
|
||||
CONST RECT *lpRect,
|
||||
LPCWSTR lpString,
|
||||
UINT cbCount,
|
||||
CONST INT *lpDx
|
||||
)
|
||||
{
|
||||
return NtGdiTextOut(hDC, X, Y, String, Count);
|
||||
return NtGdiExtTextOut(hdc, X, Y, fuOptions, lpRect, lpString, cbCount, lpDx);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1191,7 +1191,8 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta
|
|||
else
|
||||
rc.bottom = line_index * es->line_height;
|
||||
rc.bottom -= (es->y_offset * es->line_height); /* Adjust for vertical scrollbar */
|
||||
tmphrgn = CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom);
|
||||
tmphrgn = CreateRectRgn(min(rc.left, rc.right), min(rc.top, rc.bottom),
|
||||
max(rc.left, rc.right), max(rc.top, rc.bottom));
|
||||
CombineRgn(hrgn, hrgn, tmphrgn, RGN_OR);
|
||||
DeleteObject(tmphrgn);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: draw.c,v 1.29 2003/10/22 14:02:54 navaraf Exp $
|
||||
/* $Id: draw.c,v 1.30 2003/12/08 20:58:44 chorns Exp $
|
||||
*
|
||||
* PROJECT: ReactOS user32.dll
|
||||
* FILE: lib/user32/windows/input.c
|
||||
|
@ -26,6 +26,25 @@
|
|||
* 09-05-2001 CSH Created
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 1993, 1994 Alexandre Julliard
|
||||
* Copyright 2002 Bill Medland
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <windows.h>
|
||||
|
@ -1554,7 +1573,7 @@ InvertRect(
|
|||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
LONG
|
||||
STDCALL
|
||||
|
@ -1568,13 +1587,98 @@ TabbedTextOutA(
|
|||
CONST LPINT lpnTabStopPositions,
|
||||
int nTabOrigin)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
LONG ret;
|
||||
DWORD len;
|
||||
LPWSTR strW;
|
||||
|
||||
len = MultiByteToWideChar(CP_ACP, 0, lpString, nCount, NULL, 0);
|
||||
strW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
||||
if (!strW)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
MultiByteToWideChar(CP_ACP, 0, lpString, nCount, strW, len);
|
||||
ret = TabbedTextOutW(hDC, X, Y, strW, len, nTabPositions, lpnTabStopPositions, nTabOrigin);
|
||||
HeapFree(GetProcessHeap(), 0, strW);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* TEXT_TabbedTextOut
|
||||
*
|
||||
* Helper function for TabbedTextOut() and GetTabbedTextExtent().
|
||||
* Note: this doesn't work too well for text-alignment modes other
|
||||
* than TA_LEFT|TA_TOP. But we want bug-for-bug compatibility :-)
|
||||
*/
|
||||
static LONG TEXT_TabbedTextOut( HDC hdc, INT x, INT y, LPCWSTR lpstr,
|
||||
INT count, INT cTabStops, const INT *lpTabPos, INT nTabOrg,
|
||||
BOOL fDisplayText )
|
||||
{
|
||||
INT defWidth;
|
||||
SIZE extent;
|
||||
int i, tabPos = x;
|
||||
int start = x;
|
||||
|
||||
extent.cx = 0;
|
||||
extent.cy = 0;
|
||||
|
||||
if (!lpTabPos)
|
||||
cTabStops=0;
|
||||
|
||||
if (cTabStops == 1 && *lpTabPos >= /* sic */ 0)
|
||||
{
|
||||
defWidth = *lpTabPos;
|
||||
cTabStops = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
TEXTMETRICA tm;
|
||||
GetTextMetricsA( hdc, &tm );
|
||||
defWidth = 8 * tm.tmAveCharWidth;
|
||||
if (cTabStops == 1)
|
||||
cTabStops = 0; /* on negative *lpTabPos */
|
||||
}
|
||||
|
||||
while (count > 0)
|
||||
{
|
||||
for (i = 0; i < count; i++)
|
||||
if (lpstr[i] == '\t') break;
|
||||
GetTextExtentPointW( hdc, lpstr, i, &extent );
|
||||
while ((cTabStops > 0) &&
|
||||
(nTabOrg + *lpTabPos <= x + extent.cx))
|
||||
{
|
||||
lpTabPos++;
|
||||
cTabStops--;
|
||||
}
|
||||
if (i == count)
|
||||
tabPos = x + extent.cx;
|
||||
else if (cTabStops > 0)
|
||||
tabPos = nTabOrg + *lpTabPos;
|
||||
else if (defWidth <= 0)
|
||||
tabPos = x + extent.cx;
|
||||
else
|
||||
tabPos = nTabOrg + ((x + extent.cx - nTabOrg) / defWidth + 1) * defWidth;
|
||||
if (fDisplayText)
|
||||
{
|
||||
RECT r;
|
||||
r.left = x;
|
||||
r.top = y;
|
||||
r.right = tabPos;
|
||||
r.bottom = y + extent.cy;
|
||||
ExtTextOutW( hdc, x, y, GetBkMode(hdc) == OPAQUE ? ETO_OPAQUE : 0,
|
||||
&r, lpstr, i, NULL );
|
||||
}
|
||||
x = tabPos;
|
||||
count -= i+1;
|
||||
lpstr += i+1;
|
||||
}
|
||||
return MAKELONG(tabPos - start, extent.cy);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
LONG
|
||||
STDCALL
|
||||
|
@ -1588,10 +1692,10 @@ TabbedTextOutW(
|
|||
CONST LPINT lpnTabStopPositions,
|
||||
int nTabOrigin)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
return TEXT_TabbedTextOut(hDC, X, Y, lpString, nCount, nTabPositions, lpnTabStopPositions, nTabOrigin, TRUE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: text.c,v 1.54 2003/11/30 20:33:45 gdalsnes Exp $ */
|
||||
/* $Id: text.c,v 1.55 2003/12/08 20:58:44 chorns Exp $ */
|
||||
|
||||
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
|
@ -402,16 +402,17 @@ NtGdiEnumFonts(HDC hDC,
|
|||
|
||||
BOOL
|
||||
STDCALL
|
||||
NtGdiExtTextOut(HDC hDC,
|
||||
NtGdiExtTextOut(HDC hdc,
|
||||
int X,
|
||||
int Y,
|
||||
UINT Options,
|
||||
CONST LPRECT rc,
|
||||
LPCWSTR String,
|
||||
UINT Count,
|
||||
CONST LPINT Dx)
|
||||
UINT fuOptions,
|
||||
CONST RECT *lprc,
|
||||
LPCWSTR lpString,
|
||||
UINT cbCount,
|
||||
CONST INT *lpDx)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
/* FIXME: Implement */
|
||||
return NtGdiTextOut(hdc, X, Y, lpString, cbCount);
|
||||
}
|
||||
|
||||
BOOL
|
||||
|
|
Loading…
Reference in a new issue