ReactOS 0.4.16-dev-2104-gb84fa49
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
113static
114BOOL
116 _Out_ PVOID* pFileInfo,
117 _Out_ LPDWORD pdwLen)
118{
119 HRSRC hResource;
120 DWORD dwResourceSize;
121 HGLOBAL hResourceData;
122 PVOID pvResourceData;
123
124 *pFileInfo = NULL;
125 *pdwLen = 0;
126
127 /* Try to get the VersionInfo resource */
129 if (hResource == NULL)
130 return FALSE;
131
132 /* Get resource size and do basic size check */
133 dwResourceSize = SizeofResource(NULL, hResource);
134 if (dwResourceSize < sizeof(VS_FIXEDFILEINFO))
135 return FALSE;
136
137 /* Load the resource */
138 hResourceData = LoadResource(NULL, hResource);
139 if (hResourceData == NULL)
140 return FALSE;
141
142 /* Lock the resource */
143 pvResourceData = LockResource(hResourceData);
144 if (pvResourceData == NULL)
145 return FALSE;
146
147 *pFileInfo = pvResourceData;
148 *pdwLen = dwResourceSize;
149 return TRUE;
150}
151
152/* Checks the VersionInfo of the main executable for RTL layout
153 * and applies it to the process if found.
154 * See https://web.archive.org/web/20050207001156/http://www.microsoft.com/globaldev/getwr/steps/WRG_mirror.mspx
155 *
156 * This function should be called from LpkInitialize(),
157 * which is in turn called by GdiInitializeLanguagePack() (from gdi32).
158 * TODO: Move call from LpkDllInitialize() to LpkInitialize() when latter
159 * function is implemented.
160 */
161static void LPK_ApplyMirroring(void)
162{
163 PWSTR pwstrFileDescription = NULL;
164 PVOID pvFileInfo;
165 DWORD cbFileInfoSize;
166
167 /* Get the VersionInfo resource of the main executable */
168 if (!GetProcessImageVersionInfo(&pvFileInfo, &cbFileInfoSize))
169 {
170 return;
171 }
172
173 /* The length (in WCHARs) of the key name, including the null-terminator */
174 const DWORD cchKeyLength = sizeof(L"FileDescription") / sizeof(WCHAR);
175
176 /* Calculate the required length (in WCHARs) for a FileDescription entry:
177 The key (incl. null) + alignment byte + 2 LTR markers (note: the key
178 is always unaligned by 2 bytes) */
179 const DWORD cchRequired = cchKeyLength + 1 + 2;
180
181 /* Scan the VersionInfo resource for the "FileDescription" key */
182 PWSTR pwchCurrent = (PWSTR)pvFileInfo;
183 DWORD cchRemining = cbFileInfoSize / sizeof(WCHAR);
184 while (cchRemining >= cchRequired)
185 {
186 /* Compare current position with the "FileDescription" key */
187 if (lstrcmpW(pwchCurrent, L"FileDescription") == 0)
188 {
189 /* The value starts after the key, the null-terminator and 1 WCHAR alignment */
190 pwstrFileDescription = pwchCurrent + cchKeyLength + 1;
191 break;
192 }
193
194 /* Move to next position */
195 pwchCurrent++;
196 cchRemining--;
197 }
198
199 /* Check if the description starts with 2 LTR markers (u200E).
200 Yes, this is how MS marks the layout as RTL (see article linked above). */
201 if ((pwstrFileDescription != NULL) &&
202 (pwstrFileDescription[0] == 0x200E) &&
203 (pwstrFileDescription[1] == 0x200E))
204 {
206 }
207}
208
209BOOL
210WINAPI
212 _In_ HANDLE hDll,
215{
217
218 switch (dwReason)
219 {
222 /* Tell usp10 it is activated usp10 */
223 //LpkPresent();
225 break;
226
227 default:
228 break;
229 }
230
231 return TRUE;
232}
233
234
235/*
236 * @implemented
237 */
238BOOL
239WINAPI
241 HDC hdc,
242 int x,
243 int y,
244 UINT fuOptions,
245 const RECT *lprc,
246 LPCWSTR lpString,
247 UINT uCount,
248 const INT *lpDx,
249 INT unknown)
250{
252 LPWSTR reordered_str = NULL;
253 INT cGlyphs;
254 DWORD dwSICFlags = SIC_COMPLEX;
255 BOOL bResult, bReorder;
256
258
259 fuOptions |= ETO_IGNORELANGUAGE;
260
261 /* Check text direction */
263 fuOptions |= ETO_RTLREADING;
264
265 /* If text direction is RTL change flag to account neutral characters */
266 if (fuOptions & ETO_RTLREADING)
267 dwSICFlags |= SIC_NEUTRAL;
268
269 /* Check if the string requires complex script processing and not a "glyph indices" array */
270 if (ScriptIsComplex(lpString, uCount, dwSICFlags) == S_OK && !(fuOptions & ETO_GLYPH_INDEX))
271 {
272 /* reordered_str is used as fallback in case the glyphs array fails to generate,
273 BIDI_Reorder() doesn't attempt to write into reordered_str if memory allocation fails */
274 reordered_str = HeapAlloc(GetProcessHeap(), 0, uCount * sizeof(WCHAR));
275
276 bReorder = BIDI_Reorder(hdc, lpString, uCount, GCP_REORDER,
277 (fuOptions & ETO_RTLREADING) ? WINE_GCPW_FORCE_RTL : WINE_GCPW_FORCE_LTR,
278 reordered_str, uCount, NULL, &glyphs, &cGlyphs);
279
280 /* Now display the reordered text if any of the arrays is valid and if BIDI_Reorder() succeeded */
281 if ((glyphs || reordered_str) && bReorder)
282 {
283 if (glyphs)
284 {
285 fuOptions |= ETO_GLYPH_INDEX;
286 uCount = cGlyphs;
287 }
288
289 bResult = ExtTextOutW(hdc, x, y, fuOptions, lprc,
290 glyphs ? (LPWSTR)glyphs : reordered_str, uCount, lpDx);
291 }
292 else
293 {
294 WARN("BIDI_Reorder failed, falling back to original string.\n");
295 bResult = ExtTextOutW(hdc, x, y, fuOptions, lprc, lpString, uCount, lpDx);
296 }
297
299 HeapFree(GetProcessHeap(), 0, reordered_str);
300
301 return bResult;
302 }
303
304 return ExtTextOutW(hdc, x, y, fuOptions, lprc, lpString, uCount, lpDx);
305}
306
307/*
308 * @implemented
309 */
310DWORD
311WINAPI
313 HDC hdc,
314 LPCWSTR lpString,
315 INT uCount,
316 INT nMaxExtent,
317 LPGCP_RESULTSW lpResults,
319 DWORD dwUnused)
320{
321 DWORD ret = 0;
322 HRESULT hr;
324 LPWORD lpGlyphs = NULL;
325 SIZE size;
326 UINT nSet, i;
327 INT cGlyphs;
328
329 UNREFERENCED_PARAMETER(dwUnused);
330
331 /* Sanity check (most likely a direct call) */
332 if (!(dwFlags & GCP_REORDER))
333 return GetCharacterPlacementW(hdc, lpString, uCount, nMaxExtent, lpResults, dwFlags);
334
335 nSet = (UINT)uCount;
336 if (nSet > lpResults->nGlyphs)
337 nSet = lpResults->nGlyphs;
338
339 BIDI_Reorder(hdc, lpString, uCount, dwFlags, WINE_GCPW_FORCE_LTR, lpResults->lpOutString,
340 nSet, lpResults->lpOrder, &lpGlyphs, &cGlyphs);
341
342 lpResults->nGlyphs = (UINT)cGlyphs;
343
344 if (lpResults->lpGlyphs)
345 {
346 if (lpGlyphs)
347 StringCchCopyW(lpResults->lpGlyphs, cGlyphs, lpGlyphs);
348 else if (lpResults->lpOutString)
349 GetGlyphIndicesW(hdc, lpResults->lpOutString, nSet, lpResults->lpGlyphs, 0);
350 }
351
352 if (lpResults->lpDx)
353 {
354 int c;
355
356 /* If glyph shaping was requested */
358 {
359 if (lpResults->lpGlyphs)
360 {
361 for (i = 0; i < lpResults->nGlyphs; i++)
362 {
363 if (GetCharWidthI(hdc, 0, 1, (WORD *)&lpResults->lpGlyphs[i], &c))
364 lpResults->lpDx[i] = c;
365 }
366 }
367 }
368
369 else
370 {
371 for (i = 0; i < nSet; i++)
372 {
373 if (GetCharWidth32W(hdc, lpResults->lpOutString[i], lpResults->lpOutString[i], &c))
374 lpResults->lpDx[i] = c;
375 }
376 }
377 }
378
379 if (lpResults->lpCaretPos)
380 {
381 int pos = 0;
382
383 hr = ScriptStringAnalyse(hdc, lpString, nSet, (3 * nSet / 2 + 16), -1, SSA_GLYPHS, -1,
384 NULL, NULL, NULL, NULL, NULL, &ssa);
385 if (hr == S_OK)
386 {
387 for (i = 0; i < nSet; i++)
388 {
389 if (ScriptStringCPtoX(ssa, i, FALSE, &pos) == S_OK)
390 lpResults->lpCaretPos[i] = pos;
391 }
392 ScriptStringFree(&ssa);
393 }
394 else
395 {
396 lpResults->lpCaretPos[0] = 0;
397 for (i = 1; i < nSet; i++)
398 {
399 if (GetTextExtentPoint32W(hdc, &(lpString[i - 1]), 1, &size))
400 lpResults->lpCaretPos[i] = (pos += size.cx);
401 }
402 }
403 }
404
405 if (GetTextExtentPoint32W(hdc, lpString, uCount, &size))
406 ret = MAKELONG(size.cx, size.cy);
407
408 HeapFree(GetProcessHeap(), 0, lpGlyphs);
409
410 return ret;
411}
412
413/* Stripped down version of DrawText(), can only draw single line text and Prefix underscore
414 * (only on the last found amperstand).
415 * Only flags to be found to be of use in testing:
416 *
417 * DT_NOPREFIX - Draw the string as is without removal of the amperstands and without underscore
418 * DT_HIDEPREFIX - Draw the string without underscore
419 * DT_PREFIXONLY - Draw only the underscore
420 *
421 * Without any of these flags the behavior is the string being drawn without the amperstands and
422 * with the underscore.
423 * user32 has an equivalent function - UserLpkPSMTextOut().
424 *
425 * Note: lpString does not need to be null terminated.
426 */
427INT WINAPI LpkPSMTextOut(HDC hdc, int x, int y, LPCWSTR lpString, int cString, DWORD dwFlags)
428{
429 SIZE size;
431 int prefix_offset, len;
432 LPWSTR display_str = NULL;
433
434 if (!lpString || cString <= 0)
435 return 0;
436
437 if (dwFlags & DT_NOPREFIX)
438 {
439 LpkExtTextOut(hdc, x, y, 0, NULL, lpString, cString, NULL, 0);
440 GetTextExtentPointW(hdc, lpString, cString, &size);
441 return size.cx;
442 }
443
444 display_str = HeapAlloc(GetProcessHeap(), 0, (cString + 1) * sizeof(WCHAR));
445
446 if (!display_str)
447 return 0;
448
449 PSM_PrepareToDraw(lpString, cString, display_str, &len);
450
451 if (!(dwFlags & DT_PREFIXONLY))
452 LpkExtTextOut(hdc, x, y, 0, NULL, display_str, len, NULL, 0);
453
454 if (!(dwFlags & DT_HIDEPREFIX))
455 {
456 prefix_offset = PSM_FindLastPrefix(lpString, cString);
458 LPK_DrawUnderscore(hdc, x, y + tm.tmAscent + 1, display_str, len, prefix_offset);
459 }
460
461 GetTextExtentPointW(hdc, display_str, len + 1, &size);
462 HeapFree(GetProcessHeap(), 0, display_str);
463
464 return size.cx;
465}
466
467/*
468 * @implemented
469 */
470BOOL
471WINAPI
473 HDC hdc,
474 LPCWSTR lpString,
475 INT cString,
476 INT nMaxExtent,
477 LPINT lpnFit,
478 LPINT lpnDx,
479 LPSIZE lpSize,
480 DWORD dwUnused,
481 int unknown)
482{
484 HRESULT hr;
485 INT i, extent, *Dx;
487
488 UNREFERENCED_PARAMETER(dwUnused);
490
491 if (cString < 0 || !lpSize)
492 return FALSE;
493
494 if (cString == 0 || !lpString)
495 {
496 lpSize->cx = 0;
497 lpSize->cy = 0;
498 return TRUE;
499 }
500
501 /* Check if any processing is required */
502 if (ScriptIsComplex(lpString, cString, SIC_COMPLEX) != S_OK)
503 goto fallback;
504
505 hr = ScriptStringAnalyse(hdc, lpString, cString, 3 * cString / 2 + 16, -1,
506 SSA_GLYPHS, 0, NULL, NULL, NULL, NULL, NULL, &ssa);
507 if (hr != S_OK)
508 goto fallback;
509
510 /* Use logic from TextIntGetTextExtentPoint() */
511 Dx = HeapAlloc(GetProcessHeap(), 0, cString * sizeof(INT));
512 if (!Dx)
513 {
514 ScriptStringFree(&ssa);
515 goto fallback;
516 }
517
518 if (lpnFit)
519 *lpnFit = 0;
520
522
523 for (i = 0, extent = 0; i < cString; i++)
524 {
525 extent += Dx[i];
526
527 if (extent <= nMaxExtent && lpnFit)
528 *lpnFit = i + 1;
529
530 if (lpnDx)
531 lpnDx[i] = extent;
532 }
533
534 HeapFree(GetProcessHeap(), 0, Dx);
535 ScriptStringFree(&ssa);
536
537 if (!GetTextMetricsW(hdc, &tm))
538 return GetTextExtentExPointWPri(hdc, lpString, cString, 0, NULL, NULL, lpSize);
539
540 lpSize->cx = extent;
541 lpSize->cy = tm.tmHeight;
542
543 return TRUE;
544
545fallback:
546 return GetTextExtentExPointWPri(hdc, lpString, cString, nMaxExtent, lpnFit, lpnDx, lpSize);
547}
static HPEN hpen
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define index(s, c)
Definition: various.h:29
#define WARN(fmt,...)
Definition: precomp.h:61
DWORD dwReason
Definition: misc.cpp:135
#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 HeapFree(x, y, z)
Definition: compat.h:735
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4246
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
HRESULT WINAPI ScriptStringFree(SCRIPT_STRING_ANALYSIS *pssa)
Definition: usp10.c:2577
HRESULT WINAPI ScriptStringGetLogicalWidths(SCRIPT_STRING_ANALYSIS ssa, int *piDx)
Definition: usp10.c:3825
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:2432
HRESULT WINAPI ScriptIsComplex(const WCHAR *chars, int len, DWORD flag)
Definition: usp10.c:3095
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
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
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
const GLubyte * c
Definition: glext.h:8905
GLuint index
Definition: glext.h:6031
GLenum GLsizei len
Definition: glext.h:6722
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 S_OK
Definition: intsafe.h:52
#define c
Definition: ke_i.h:80
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:427
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:211
static void LPK_DrawUnderscore(HDC hdc, int x, int y, LPCWSTR str, int count, int offset)
Definition: lpk.c:66
static BOOL GetProcessImageVersionInfo(_Out_ PVOID *pFileInfo, _Out_ LPDWORD pdwLen)
Definition: lpk.c:115
static void LPK_ApplyMirroring(void)
Definition: lpk.c:161
#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
int * LPINT
Definition: minwindef.h:151
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static UINT UINT LPWORD glyphs
Definition: font.c:44
unsigned int UINT
Definition: ndis.h:50
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
_Out_ PVOID pReserved
Definition: netsh.h:77
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
#define VS_VERSION_INFO
Definition: ntverrsrc.c:27
#define RT_VERSION
Definition: ntverrsrc.c:26
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 iswspace(_c)
Definition: ctype.h:669
HRESULT hr
Definition: shlfolder.c:183
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
INT * lpCaretPos
Definition: wingdi.h:2881
LPWSTR lpOutString
Definition: wingdi.h:2878
UINT * lpOrder
Definition: wingdi.h:2879
LPWSTR lpGlyphs
Definition: wingdi.h:2883
Definition: windef.h:99
LONG cx
Definition: windef.h:128
LONG cy
Definition: windef.h:129
uint16_t * PWSTR
Definition: typedefs.h:56
uint16_t * LPWORD
Definition: typedefs.h:56
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
#define MAKELONG(a, b)
Definition: typedefs.h:249
uint32_t ULONG
Definition: typedefs.h:59
BOOL WINAPI GetTextExtentExPointWPri(_In_ HDC hdc, _In_reads_(cwc) PCWCH lpwsz, _In_ INT cwc, _In_ INT dxMax, _Out_opt_ LPINT pcCh, _Out_writes_to_opt_(cwc, *pcCh) LPINT pdxOut, _In_ LPSIZE psize)
Definition: text.c:311
#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
BOOL WINAPI SetProcessDefaultLayout(DWORD dwDefaultLayout)
Definition: window.c:1689
_In_ FONTOBJ _In_ ULONG _In_ ULONG cGlyphs
Definition: winddi.h:3799
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:3451
#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:837
COLORREF WINAPI GetTextColor(_In_ HDC)
Definition: text.c:860
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:1546
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:4568
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define DT_HIDEPREFIX
Definition: winuser.h:547
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184