wine-wine/dlls/gdi32/bidi.c

63 lines
2.1 KiB
C
Raw Normal View History

/*
* GDI BiDirectional handling
*
* Copyright 2003 Shachar Shemesh
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "gdi_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(bidi);
/*************************************************************
* BIDI_Reorder
*/
BOOL BIDI_Reorder(
LPCWSTR lpString, /* [in] The string for which information is to be returned */
INT uCount, /* [in] Number of WCHARs in string. */
DWORD dwFlags, /* [in] GetCharacterPlacement compatible flags specifying how to process the string */
DWORD dwWineGCP_Flags, /* [in] Wine internal flags - Force paragraph direction */
LPWSTR lpOutString, /* [out] Reordered string */
INT uCountOut, /* [in] Size of output buffer */
UINT *lpOrder /* [out] Logical -> Visual order map */
)
{
unsigned i;
TRACE("%s, %d, 0x%08x lpOutString=%p, lpOrder=%p\n",
2004-01-27 00:01:43 +00:00
debugstr_wn(lpString, uCount), uCount, dwFlags,
lpOutString, lpOrder);
if (!(dwFlags & GCP_REORDER))
{
FIXME("Asked to reorder without reorder flag set\n");
return FALSE;
}
memcpy(lpOutString, lpString, uCount * sizeof(WCHAR));
if (lpOrder)
for (i = 0; i < uCount; ++i)
*(lpOrder++) = i;
return TRUE;
}