ReactOS 0.4.15-dev-7958-gcd0bb1a
lpk.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS LPK
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Language Pack DLL.
5 * PROGRAMMERS: Magnus Olsen (greatlrd)
6 * Baruch Rutman (peterooch at gmail dot com)
7 */
8
9#include "ros_lpk.h"
10
12
17
18#define PREFIX 38
19#define ALPHA_PREFIX 30 /* Win16: Alphabet prefix */
20#define KANA_PREFIX 31 /* Win16: Katakana prefix */
21
23{
24 int i, prefix_count = 0, index = -1;
25
26 for (i = 0; i < count - 1; i++)
27 {
28 if (str[i] == PREFIX && str[i + 1] != PREFIX)
29 {
30 index = i - prefix_count;
31 prefix_count++;
32 }
33 else if (str[i] == PREFIX && str[i + 1] == PREFIX)
34 {
35 i++;
36 }
37 }
38 return index;
39}
40
41static void PSM_PrepareToDraw(LPCWSTR str, INT count, LPWSTR new_str, LPINT new_count)
42{
43 int len, i = 0, j = 0;
44
45 while (i < count)
46 {
47 if (str[i] == PREFIX || (iswspace(str[i]) && str[i] != L' '))
48 {
49 if (i < count - 1 && str[i + 1] == PREFIX)
50 new_str[j++] = str[i++];
51 else
52 i++;
53 }
54 else
55 {
56 new_str[j++] = str[i++];
57 }
58 }
59
60 new_str[j] = L'\0';
61 len = wcslen(new_str);
62 *new_count = len;
63}
64
65/* Can be used with also LpkDrawTextEx() if it will be implemented */
66static void LPK_DrawUnderscore(HDC hdc, int x, int y, LPCWSTR str, int count, int offset)
67{
69 DWORD dwSSAFlags = SSA_GLYPHS;
70 int prefix_x;
71 int prefix_end;
72 int pos;
73 SIZE size;
74 HPEN hpen;
75 HPEN oldPen;
77
78 if (offset == -1)
79 return;
80
82 {
84 dwSSAFlags |= SSA_RTL;
85
86 hr = ScriptStringAnalyse(hdc, str, count, (3 * count / 2 + 16),
87 -1, dwSSAFlags, -1, NULL, NULL, NULL, NULL, NULL, &ssa);
88 }
89
90 if (hr == S_OK)
91 {
93 prefix_x = x + pos;
95 prefix_end = x + pos;
96 ScriptStringFree(&ssa);
97 }
98 else
99 {
101 prefix_x = x + size.cx;
103 prefix_end = x + size.cx - 1;
104 }
106 oldPen = SelectObject(hdc, hpen);
107 MoveToEx(hdc, prefix_x, y, NULL);
108 LineTo(hdc, prefix_end, y);
109 SelectObject(hdc, oldPen);
111}
112
113/* Code taken from the GetProcessDefaultLayout() function from Wine's user32
114 * Wine version 3.17
115 *
116 * This function should be called from LpkInitialize(),
117 * which is in turn called by GdiInitializeLanguagePack() (from gdi32).
118 * TODO: Move call from LpkDllInitialize() to LpkInitialize() when latter
119 * function is implemented.
120 */
122{
123 static const WCHAR translationW[] = { '\\','V','a','r','F','i','l','e','I','n','f','o',
124 '\\','T','r','a','n','s','l','a','t','i','o','n', 0 };
125 static const WCHAR filedescW[] = { '\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o',
126 '\\','%','0','4','x','%','0','4','x',
127 '\\','F','i','l','e','D','e','s','c','r','i','p','t','i','o','n',0 };
129#ifdef __REACTOS__
130 DWORD i, version_layout = 0;
131 UINT len;
132#else
133 DWORD i, len, version_layout = 0;
134#endif
135 DWORD user_lang = GetUserDefaultLangID();
136 DWORD *languages;
137 void *data = NULL;
138
140 if (!(len = GetFileVersionInfoSizeW( buffer, NULL ))) goto done;
141 if (!(data = HeapAlloc( GetProcessHeap(), 0, len ))) goto done;
142 if (!GetFileVersionInfoW( buffer, 0, len, data )) goto done;
143 if (!VerQueryValueW( data, translationW, (void **)&languages, &len ) || !len) goto done;
144
145 len /= sizeof(DWORD);
146 for (i = 0; i < len; i++) if (LOWORD(languages[i]) == user_lang) break;
147 if (i == len) /* try neutral language */
148 for (i = 0; i < len; i++)
149 if (LOWORD(languages[i]) == MAKELANGID( PRIMARYLANGID(user_lang), SUBLANG_NEUTRAL )) break;
150 if (i == len) i = 0; /* default to the first one */
151
152 sprintfW( buffer, filedescW, LOWORD(languages[i]), HIWORD(languages[i]) );
153 if (!VerQueryValueW( data, buffer, (void **)&str, &len )) goto done;
154 TRACE( "found description %s\n", debugstr_w( str ));
155 if (str[0] == 0x200e && str[1] == 0x200e) version_layout = LAYOUT_RTL;
156
157done:
159 SetProcessDefaultLayout(version_layout);
160}
161
162BOOL
163WINAPI
165 _In_ HANDLE hDll,
167 _In_opt_ PVOID pReserved)
168{
169 UNREFERENCED_PARAMETER(pReserved);
170
171 switch (dwReason)
172 {
175 /* Tell usp10 it is activated usp10 */
176 //LpkPresent();
178 break;
179
180 default:
181 break;
182 }
183
184 return TRUE;
185}
186
187
188/*
189 * @implemented
190 */
191BOOL
192WINAPI
194 HDC hdc,
195 int x,
196 int y,
197 UINT fuOptions,
198 const RECT *lprc,
199 LPCWSTR lpString,
200 UINT uCount,
201 const INT *lpDx,
202 INT unknown)
203{
205 LPWSTR reordered_str = NULL;
206 INT cGlyphs;
207 DWORD dwSICFlags = SIC_COMPLEX;
208 BOOL bResult, bReorder;
209
211
212 fuOptions |= ETO_IGNORELANGUAGE;
213
214 /* Check text direction */
216 fuOptions |= ETO_RTLREADING;
217
218 /* If text direction is RTL change flag to account neutral characters */
219 if (fuOptions & ETO_RTLREADING)
220 dwSICFlags |= SIC_NEUTRAL;
221
222 /* Check if the string requires complex script processing and not a "glyph indices" array */
223 if (ScriptIsComplex(lpString, uCount, dwSICFlags) == S_OK && !(fuOptions & ETO_GLYPH_INDEX))
224 {
225 /* reordered_str is used as fallback in case the glyphs array fails to generate,
226 BIDI_Reorder() doesn't attempt to write into reordered_str if memory allocation fails */
227 reordered_str = HeapAlloc(GetProcessHeap(), 0, uCount * sizeof(WCHAR));
228
229 bReorder = BIDI_Reorder(hdc, lpString, uCount, GCP_REORDER,
230 (fuOptions & ETO_RTLREADING) ? WINE_GCPW_FORCE_RTL : WINE_GCPW_FORCE_LTR,
231 reordered_str, uCount, NULL, &glyphs, &cGlyphs);
232
233 /* Now display the reordered text if any of the arrays is valid and if BIDI_Reorder() succeeded */
234 if ((glyphs || reordered_str) && bReorder)
235 {
236 if (glyphs)
237 {
238 fuOptions |= ETO_GLYPH_INDEX;
239 uCount = cGlyphs;
240 }
241
242 bResult = ExtTextOutW(hdc, x, y, fuOptions, lprc,
243 glyphs ? (LPWSTR)glyphs : reordered_str, uCount, lpDx);
244 }
245 else
246 {
247 WARN("BIDI_Reorder failed, falling back to original string.\n");
248 bResult = ExtTextOutW(hdc, x, y, fuOptions, lprc, lpString, uCount, lpDx);
249 }
250
252 HeapFree(GetProcessHeap(), 0, reordered_str);
253
254 return bResult;
255 }
256
257 return ExtTextOutW(hdc, x, y, fuOptions, lprc, lpString, uCount, lpDx);
258}
259
260/*
261 * @implemented
262 */
263DWORD
264WINAPI
266 HDC hdc,
267 LPCWSTR lpString,
268 INT uCount,
269 INT nMaxExtent,
270 LPGCP_RESULTSW lpResults,
272 DWORD dwUnused)
273{
274 DWORD ret = 0;
275 HRESULT hr;
277 LPWORD lpGlyphs = NULL;
278 SIZE size;
279 UINT nSet, i;
280 INT cGlyphs;
281
282 UNREFERENCED_PARAMETER(dwUnused);
283
284 /* Sanity check (most likely a direct call) */
285 if (!(dwFlags & GCP_REORDER))
286 return GetCharacterPlacementW(hdc, lpString, uCount, nMaxExtent, lpResults, dwFlags);
287
288 nSet = (UINT)uCount;
289 if (nSet > lpResults->nGlyphs)
290 nSet = lpResults->nGlyphs;
291
292 BIDI_Reorder(hdc, lpString, uCount, dwFlags, WINE_GCPW_FORCE_LTR, lpResults->lpOutString,
293 nSet, lpResults->lpOrder, &lpGlyphs, &cGlyphs);
294
295 lpResults->nGlyphs = (UINT)cGlyphs;
296
297 if (lpResults->lpGlyphs)
298 {
299 if (lpGlyphs)
300 StringCchCopyW(lpResults->lpGlyphs, cGlyphs, lpGlyphs);
301 else if (lpResults->lpOutString)
302 GetGlyphIndicesW(hdc, lpResults->lpOutString, nSet, lpResults->lpGlyphs, 0);
303 }
304
305 if (lpResults->lpDx)
306 {
307 int c;
308
309 /* If glyph shaping was requested */
311 {
312 if (lpResults->lpGlyphs)
313 {
314 for (i = 0; i < lpResults->nGlyphs; i++)
315 {
316 if (GetCharWidthI(hdc, 0, 1, (WORD *)&lpResults->lpGlyphs[i], &c))
317 lpResults->lpDx[i] = c;
318 }
319 }
320 }
321
322 else
323 {
324 for (i = 0; i < nSet; i++)
325 {
326 if (GetCharWidth32W(hdc, lpResults->lpOutString[i], lpResults->lpOutString[i], &c))
327 lpResults->lpDx[i] = c;
328 }
329 }
330 }
331
332 if (lpResults->lpCaretPos)
333 {
334 int pos = 0;
335
336 hr = ScriptStringAnalyse(hdc, lpString, nSet, (3 * nSet / 2 + 16), -1, SSA_GLYPHS, -1,
337 NULL, NULL, NULL, NULL, NULL, &ssa);
338 if (hr == S_OK)
339 {
340 for (i = 0; i < nSet; i++)
341 {
342 if (ScriptStringCPtoX(ssa, i, FALSE, &pos) == S_OK)
343 lpResults->lpCaretPos[i] = pos;
344 }
345 ScriptStringFree(&ssa);
346 }
347 else
348 {
349 lpResults->lpCaretPos[0] = 0;
350 for (i = 1; i < nSet; i++)
351 {
352 if (GetTextExtentPoint32W(hdc, &(lpString[i - 1]), 1, &size))
353 lpResults->lpCaretPos[i] = (pos += size.cx);
354 }
355 }
356 }
357
358 if (GetTextExtentPoint32W(hdc, lpString, uCount, &size))
359 ret = MAKELONG(size.cx, size.cy);
360
361 HeapFree(GetProcessHeap(), 0, lpGlyphs);
362
363 return ret;
364}
365
366/* Stripped down version of DrawText(), can only draw single line text and Prefix underscore
367 * (only on the last found amperstand).
368 * Only flags to be found to be of use in testing:
369 *
370 * DT_NOPREFIX - Draw the string as is without removal of the amperstands and without underscore
371 * DT_HIDEPREFIX - Draw the string without underscore
372 * DT_PREFIXONLY - Draw only the underscore
373 *
374 * Without any of these flags the behavior is the string being drawn without the amperstands and
375 * with the underscore.
376 * user32 has an equivalent function - UserLpkPSMTextOut().
377 *
378 * Note: lpString does not need to be null terminated.
379 */
380INT WINAPI LpkPSMTextOut(HDC hdc, int x, int y, LPCWSTR lpString, int cString, DWORD dwFlags)
381{
382 SIZE size;
384 int prefix_offset, len;
385 LPWSTR display_str = NULL;
386
387 if (!lpString || cString <= 0)
388 return 0;
389
390 if (dwFlags & DT_NOPREFIX)
391 {
392 LpkExtTextOut(hdc, x, y, 0, NULL, lpString, cString, NULL, 0);
393 GetTextExtentPointW(hdc, lpString, cString, &size);
394 return size.cx;
395 }
396
397 display_str = HeapAlloc(GetProcessHeap(), 0, (cString + 1) * sizeof(WCHAR));
398
399 if (!display_str)
400 return 0;
401
402 PSM_PrepareToDraw(lpString, cString, display_str, &len);
403
404 if (!(dwFlags & DT_PREFIXONLY))
405 LpkExtTextOut(hdc, x, y, 0, NULL, display_str, len, NULL, 0);
406
407 if (!(dwFlags & DT_HIDEPREFIX))
408 {
409 prefix_offset = PSM_FindLastPrefix(lpString, cString);
411 LPK_DrawUnderscore(hdc, x, y + tm.tmAscent + 1, display_str, len, prefix_offset);
412 }
413
414 GetTextExtentPointW(hdc, display_str, len + 1, &size);
415 HeapFree(GetProcessHeap(), 0, display_str);
416
417 return size.cx;
418}
419
420/*
421 * @implemented
422 */
423BOOL
424WINAPI
426 HDC hdc,
427 LPCWSTR lpString,
428 INT cString,
429 INT nMaxExtent,
430 LPINT lpnFit,
431 LPINT lpnDx,
432 LPSIZE lpSize,
433 DWORD dwUnused,
434 int unknown)
435{
437 HRESULT hr;
438 INT i, extent, *Dx;
440
441 UNREFERENCED_PARAMETER(dwUnused);
443
444 if (cString < 0 || !lpSize)
445 return FALSE;
446
447 if (cString == 0 || !lpString)
448 {
449 lpSize->cx = 0;
450 lpSize->cy = 0;
451 return TRUE;
452 }
453
454 /* Check if any processing is required */
455 if (ScriptIsComplex(lpString, cString, SIC_COMPLEX) != S_OK)
456 goto fallback;
457
458 hr = ScriptStringAnalyse(hdc, lpString, cString, 3 * cString / 2 + 16, -1,
459 SSA_GLYPHS, 0, NULL, NULL, NULL, NULL, NULL, &ssa);
460 if (hr != S_OK)
461 goto fallback;
462
463 /* Use logic from TextIntGetTextExtentPoint() */
464 Dx = HeapAlloc(GetProcessHeap(), 0, cString * sizeof(INT));
465 if (!Dx)
466 {
467 ScriptStringFree(&ssa);
468 goto fallback;
469 }
470
471 if (lpnFit)
472 *lpnFit = 0;
473
475
476 for (i = 0, extent = 0; i < cString; i++)
477 {
478 extent += Dx[i];
479
480 if (extent <= nMaxExtent && lpnFit)
481 *lpnFit = i + 1;
482
483 if (lpnDx)
484 lpnDx[i] = extent;
485 }
486
487 HeapFree(GetProcessHeap(), 0, Dx);
488 ScriptStringFree(&ssa);
489
490 if (!GetTextMetricsW(hdc, &tm))
491 return GetTextExtentExPointWPri(hdc, lpString, cString, 0, NULL, NULL, lpSize);
492
493 lpSize->cx = extent;
494 lpSize->cy = tm.tmHeight;
495
496 return TRUE;
497
498fallback:
499 return GetTextExtentExPointWPri(hdc, lpString, cString, nMaxExtent, lpnFit, lpnDx, lpSize);
500}
static HPEN hpen
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define index(s, c)
Definition: various.h:29
DWORD dwReason
Definition: misc.cpp:154
#define WARN(fmt,...)
Definition: debug.h:112
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605
#define GetProcessHeap()
Definition: compat.h:736
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
HRESULT WINAPI ScriptStringFree(SCRIPT_STRING_ANALYSIS *pssa)
Definition: usp10.c:2556
HRESULT WINAPI ScriptStringGetLogicalWidths(SCRIPT_STRING_ANALYSIS ssa, int *piDx)
Definition: usp10.c:3804
HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString, int cGlyphs, int iCharset, DWORD dwFlags, int iReqWidth, SCRIPT_CONTROL *psControl, SCRIPT_STATE *psState, const int *piDx, SCRIPT_TABDEF *pTabdef, const BYTE *pbInClass, SCRIPT_STRING_ANALYSIS *pssa)
Definition: usp10.c:1985
HRESULT WINAPI ScriptStringCPtoX(SCRIPT_STRING_ANALYSIS ssa, int icp, BOOL fTrailing, int *pX)
Definition: usp10.c:2411
HRESULT WINAPI ScriptIsComplex(const WCHAR *chars, int len, DWORD flag)
Definition: usp10.c:3074
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:845
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1049
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:611
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
pKey DeleteObject()
DWORD WINAPI GetLayout(_In_ HDC hdc)
Definition: coord.c:750
LPKGCP LpkGetCharacterPlacement
Definition: utils.c:6
LPKETO LpkExtTextOut
Definition: utils.c:5
LPKGTEP LpkGetTextExtentExPoint
Definition: utils.c:7
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
const GLubyte * c
Definition: glext.h:8905
GLuint index
Definition: glext.h:6031
GLenum GLsizei len
Definition: glext.h:6722
GLintptr offset
Definition: glext.h:5920
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define iswspace(_c)
Definition: ctype.h:669
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define S_OK
Definition: intsafe.h:52
#define c
Definition: ke_i.h:80
#define debugstr_w
Definition: kernel32.h:32
LANGID WINAPI GetUserDefaultLangID(void)
Definition: lang.c:744
BOOL BIDI_Reorder(HDC hDC, LPCWSTR lpString, INT uCount, DWORD dwFlags, DWORD dwWineGCP_Flags, LPWSTR lpOutString, INT uCountOut, UINT *lpOrder, WORD **lpGlyphs, INT *cGlyphs)
Definition: bidi.c:320
INT WINAPI LpkPSMTextOut(HDC hdc, int x, int y, LPCWSTR lpString, int cString, DWORD dwFlags)
Definition: lpk.c:380
static void PSM_PrepareToDraw(LPCWSTR str, INT count, LPWSTR new_str, LPINT new_count)
Definition: lpk.c:41
BOOL WINAPI LpkDllInitialize(_In_ HANDLE hDll, _In_ ULONG dwReason, _In_opt_ PVOID pReserved)
Definition: lpk.c:164
static void LPK_DrawUnderscore(HDC hdc, int x, int y, LPCWSTR str, int count, int offset)
Definition: lpk.c:66
static void LPK_ApplyMirroring()
Definition: lpk.c:121
#define PREFIX
Definition: lpk.c:18
static int PSM_FindLastPrefix(LPCWSTR str, int count)
Definition: lpk.c:22
LPK_LPEDITCONTROL_LIST LpkEditControl
Definition: lpk.c:13
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
static UINT UINT LPWORD glyphs
Definition: font.c:44
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
unsigned int UINT
Definition: ndis.h:50
#define DWORD
Definition: nt_native.h:44
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define sprintfW
Definition: unicode.h:58
DWORD WINAPI EditNextWord(DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5, DWORD x6, DWORD x7)
Definition: stub.c:116
DWORD WINAPI EditIchToXY(DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5)
Definition: stub.c:67
DWORD WINAPI EditAdjustCaret(DWORD x1, DWORD x2, DWORD x3, DWORD x5)
Definition: stub.c:140
DWORD WINAPI EditCreate(DWORD x1, DWORD x2)
Definition: stub.c:61
DWORD WINAPI EditSetMenu(DWORD x1, DWORD x2)
Definition: stub.c:122
DWORD WINAPI EditGetLineWidth(DWORD x1, DWORD x2, DWORD x3, DWORD x4)
Definition: stub.c:86
DWORD WINAPI EditMouseToIch(DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5)
Definition: stub.c:73
DWORD WINAPI EditCreateCaret(DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5)
Definition: stub.c:134
DWORD WINAPI EditDrawText(DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5, DWORD x6, DWORD x7)
Definition: stub.c:92
DWORD WINAPI EditHScroll(DWORD x1, DWORD x2, DWORD x3)
Definition: stub.c:98
DWORD WINAPI EditMoveSelection(DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5)
Definition: stub.c:104
DWORD WINAPI EditProcessMenu(DWORD x1, DWORD x2)
Definition: stub.c:128
DWORD WINAPI EditCchInWidth(DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5)
Definition: stub.c:79
#define WINE_GCPW_FORCE_LTR
Definition: ros_lpk.h:88
#define WINE_GCPW_FORCE_RTL
Definition: ros_lpk.h:89
DWORD WINAPI EditVerifyText(DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5, DWORD x6)
Definition: stub.c:110
const WCHAR * str
#define MAKELANGID(p, s)
Definition: nls.h:15
#define SUBLANG_NEUTRAL
Definition: nls.h:167
#define PRIMARYLANGID(l)
Definition: nls.h:16
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
INT * lpCaretPos
Definition: wingdi.h:2435
LPWSTR lpOutString
Definition: wingdi.h:2432
UINT * lpOrder
Definition: wingdi.h:2433
LPWSTR lpGlyphs
Definition: wingdi.h:2437
LONG cx
Definition: windef.h:334
LONG cy
Definition: windef.h:335
Definition: time.h:68
uint16_t * LPWORD
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
#define MAKELONG(a, b)
Definition: typedefs.h:249
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
BOOL WINAPI GetTextExtentExPointWPri(HDC hdc, LPCWSTR lpwsz, INT cwc, INT dxMax, LPINT pcCh, LPINT pdxOut, LPSIZE psize)
#define SIC_COMPLEX
Definition: usp10.h:56
#define SIC_NEUTRAL
Definition: usp10.h:58
#define SSA_GLYPHS
Definition: usp10.h:40
#define SSA_RTL
Definition: usp10.h:41
int ret
BOOL WINAPI SetProcessDefaultLayout(DWORD dwDefaultLayout)
Definition: window.c:1719
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ FONTOBJ _In_ ULONG _In_ ULONG cGlyphs
Definition: winddi.h:3799
int * LPINT
Definition: windef.h:178
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define GCP_GLYPHSHAPE
Definition: wingdi.h:833
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
BOOL WINAPI GetCharWidthI(_In_ HDC hdc, _In_ UINT giFirst, _In_ UINT cgi, _In_reads_opt_(cgi) LPWORD pgi, _Out_writes_(cgi) LPINT piWidths)
UINT WINAPI GetTextAlign(_In_ HDC)
Definition: text.c:838
COLORREF WINAPI GetTextColor(_In_ HDC)
Definition: text.c:861
DWORD WINAPI GetCharacterPlacementW(_In_ HDC hdc, _In_reads_(nCount) LPCWSTR lpString, _In_ int nCount, _In_ int nMexExtent, _Inout_ LPGCP_RESULTSW lpResults, _In_ DWORD dwFlags)
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
#define LAYOUT_RTL
Definition: wingdi.h:1371
#define TA_RTLREADING
Definition: wingdi.h:934
BOOL WINAPI ExtTextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCWSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
#define GCP_REORDER
Definition: wingdi.h:843
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
BOOL WINAPI GetCharWidth32W(_In_ HDC hdc, _In_ UINT iFirst, _In_ UINT iLast, _Out_writes_(iLast+1 - iFirst) LPINT lpBuffer)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
#define PS_SOLID
Definition: wingdi.h:586
BOOL WINAPI GetTextExtentPoint32W(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE psizl)
#define DT_NOPREFIX
Definition: winuser.h:537
#define DT_PREFIXONLY
Definition: winuser.h:548
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4466
#define DT_HIDEPREFIX
Definition: winuser.h:547
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185