2003-06-27 20:47:16 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2003-06-27 20:47:16 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include "windef.h"
|
2003-06-27 20:47:16 +00:00
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "wine/debug.h"
|
2004-01-16 02:01:32 +00:00
|
|
|
#include "gdi_private.h"
|
2003-06-27 20:47:16 +00:00
|
|
|
|
|
|
|
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 */
|
|
|
|
)
|
|
|
|
{
|
2007-09-11 11:07:56 +00:00
|
|
|
unsigned i;
|
2006-10-12 20:56:56 +00:00
|
|
|
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);
|
2003-06-27 20:47:16 +00:00
|
|
|
|
2007-09-11 11:07:56 +00:00
|
|
|
if (!(dwFlags & GCP_REORDER))
|
|
|
|
{
|
|
|
|
FIXME("Asked to reorder without reorder flag set\n");
|
|
|
|
return FALSE;
|
2003-06-27 20:47:16 +00:00
|
|
|
}
|
2007-09-11 11:07:56 +00:00
|
|
|
memcpy(lpOutString, lpString, uCount * sizeof(WCHAR));
|
|
|
|
if (lpOrder)
|
|
|
|
for (i = 0; i < uCount; ++i)
|
|
|
|
*(lpOrder++) = i;
|
|
|
|
|
2003-06-27 20:47:16 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|