35{
40 static CHAR text[] =
"Example text for testing DrawText in "
41 "MM_HIENGLISH mode";
42 static WCHAR textW[] = {
'W',
'i',
'd',
'e',
' ',
'c',
'h',
'a',
'r',
' ',
43 's','t','r','i','n','g','\0'};
44 static CHAR emptystring[] =
"";
46 static CHAR wordbreak_text[] =
"line1 line2";
47 static WCHAR wordbreak_textW[] = {
'l',
'i',
'n',
'e',
'1',
' ',
'l',
'i',
'n',
'e',
'2',0};
48 static char tabstring[] = "one\ttwo";
49 INT textlen, textheight, heightcheck;
54
55
57 0, 0, 200, 200, 0, 0, 0,
NULL);
63
64
65 memset(&lf, 0,
sizeof(lf));
72
73
77 ok(
hFont != 0,
"CreateFontIndirectA error %u\n",
80
85
86 trace(
"MM_HIENGLISH rect.bottom %d\n",
rect.bottom);
87 ok(
rect.bottom < 0,
"In MM_HIENGLISH, DrawText with "
88 "DT_CALCRECT should return a negative rectangle bottom. "
89 "(bot=%d)\n",
rect.bottom);
90
94
95
96
101 ok(
hFont != 0,
"CreateFontIndirectA error %u\n",
104
109
110 trace(
"MM_TEXT rect.bottom %d\n",
rect.bottom);
111 ok(
rect.bottom > 0,
"In MM_TEXT, DrawText with DT_CALCRECT "
112 "should return a positive rectangle bottom. (bot=%d)\n",
114
115
116
121 ok(textheight==0,
"Got textheight from DrawTextExA\n");
122
127 if (conform_xp)
128 ok(textheight==0,
"Got textheight from DrawTextA\n");
129 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
130
135 ok(textheight!=0,
"Failed to get textheight from DrawTextExA\n");
136
140 ok(textheight!=0,
"Failed to get textheight from DrawTextA\n");
141 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
142
147 if (!textheight)
148 {
149 if (conform_xp)
150 win_skip(
"XP conformity failed, skipping XP tests. Probably winNT\n");
152 }
153 else
154 ok(textheight!=0,
"Failed to get textheight from DrawTextExA\n");
155
159 if (conform_xp)
160 ok(textheight!=0,
"Failed to get textheight from DrawTextA\n");
161 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
162
167 if (conform_xp)
168 ok(textheight==0,
"Got textheight from DrawTextExA\n");
169
174 if (conform_xp)
175 ok(textheight==0,
"Got textheight from DrawTextA\n");
176 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
177
178
179
184 if (conform_xp)
185 ok(textheight==0,
"Got textheight from DrawTextExA\n");
186
191 if (conform_xp)
192 ok(textheight==0,
"Got textheight from DrawTextA\n");
193 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
194
200 ok(textheight!=0,
"Failed to get textheight from DrawTextExA\n");
201
206 ok(textheight!=0,
"Failed to get textheight from DrawTextA\n");
207 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
208
214 if (conform_xp)
215 ok(textheight!=0,
"Failed to get textheight from DrawTextExA\n");
216
221 if (conform_xp)
222 ok(textheight!=0,
"Failed to get textheight from DrawTextA\n");
223 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
224
229 if (conform_xp)
230 ok(textheight==0,
"Got textheight from DrawTextExA\n");
231
236 if (conform_xp)
237 ok(textheight==0,
"Got textheight from DrawTextA\n");
238 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
239
240
242 if (conform_xp)
243 ok(textheight==0,
"Got textheight from DrawTextA\n");
245 if (conform_xp)
246 ok(textheight==0,
"Got textheight from DrawTextExA\n");
247 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
249 if (conform_xp)
250 ok(textheight==0,
"Got textheight from DrawTextA\n");
252 if (conform_xp)
253 ok(textheight==0,
"Got textheight from DrawTextExA\n");
254 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
256 if (conform_xp)
257 ok(textheight==0,
"Got textheight from DrawTextA\n");
259 if (conform_xp)
260 ok(textheight==0,
"Got textheight from DrawTextExA\n");
261 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
263 ok(textheight!=0,
"Failed to get textheight from DrawTextA\n");
265 ok(textheight!=0,
"Failed to get textheight from DrawTextExA\n");
266 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
268 if (conform_xp)
269 ok(textheight!=0,
"Failed to get textheight from DrawTextA\n");
271 if (conform_xp)
272 ok(textheight!=0,
"Failed to get textheight from DrawTextExA\n");
273 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
275 ok(textheight==0,
"Got textheight from DrawTextA\n");
277 ok(textheight==0,
"Got textheight from DrawTextA\n");
278 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
279
280
283 ok(textheight == 1,
"Expect returned height:1 got:%d\n", textheight);
284
287 ok(textheight == 1,
"Expect returned height:1 got:%d\n", textheight);
288
291
294 ok(textheight == 1,
"Expect returned height:1 got:%d\n", textheight);
295
296
300 ok(textheight==0,
"Got textheight from DrawTextExA\n");
304 ok(textheight==0,
"Got textheight from DrawTextExA\n");
308 ok(textheight==0,
"Got textheight from DrawTextExA\n");
312 ok(textheight==0,
"Got textheight from DrawTextExA\n");
316 ok(textheight==0,
"Got textheight from DrawTextExA\n");
318
319
325 textlen =
rect.right;
335
336
343 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
344
349 ok(textheight!=0,
"Failed to get textheight from DrawTextW\n");
350 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
351
355 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
356
360 ok(textheight!=0,
"Failed to get textheight from DrawTextW\n");
361 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
362
367 if (textheight)
368 {
369 if (conform_xp)
370 win_skip(
"XP conformity failed, skipping XP tests. Probably win 2000\n");
372 }
373 else
374 ok(textheight==0,
"Got textheight from DrawTextExW\n");
375
380 if (conform_xp)
381 ok(textheight==0,
"Got textheight from DrawTextW\n");
382 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
383
384 if (conform_xp) {
385
390 ok(textheight==0,
"Got textheight from DrawTextExW\n");
391
396 ok(textheight==0,
"Got textheight from DrawTextW\n");
397 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
398 }
399
400
401
402
406 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
407
412 ok(textheight!=0,
"Failed to get textheight from DrawTextW\n");
413 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
414
419 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
420
425 ok(textheight!=0,
"Failed to get textheight from DrawTextW\n");
426 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
427
428 if (conform_xp) {
429
434 ok(textheight==0,
"Got textheight from DrawTextExW\n");
435
440 ok(textheight==0,
"Got textheight from DrawTextW\n");
441 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
442 }
443
448 if (conform_xp)
449 ok(textheight==0,
"Got textheight from DrawTextExW\n");
450
455 if (conform_xp)
456 ok(textheight==0,
"Got textheight from DrawTextW\n");
457 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
458
459
461 ok(textheight!=0,
"Failed to get textheight from DrawTextW\n");
463 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
464 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
466 ok(textheight!=0,
"Failed to get textheight from DrawTextW\n");
468 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
469 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
471 if (conform_xp)
472 ok(textheight==0,
"Got textheight from DrawTextW\n");
474 if (conform_xp)
475 ok(textheight==0,
"Got textheight from DrawTextExW\n");
476 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
478 ok(textheight!=0,
"Failed to get textheight from DrawTextW\n");
480 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
481 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
482 if (conform_xp) {
483
485 ok(textheight==0,
"Got textheight from DrawTextW\n");
487 ok(textheight==0,
"Got textheight from DrawTextExW\n");
488 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
490 ok(textheight==0,
"Got textheight from DrawTextW\n");
492 ok(textheight==0,
"Got textheight from DrawTextW\n");
493 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
494 }
495
499 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
503 if (conform_xp)
504 ok(textheight==0,
"Got textheight from DrawTextExW\n");
508 if (conform_xp)
509 ok(textheight==0,
"Got textheight from DrawTextExW\n");
513 ok(textheight==0,
"Got textheight from DrawTextExW\n");
515 if (conform_xp) {
516
519 ok(textheight==0,
"Got textheight from DrawTextExW\n");
521 }
522 }
523
524
528 ok(0 ==
rect.left,
"expected 0, got %d\n",
rect.left);
529 ok(0 ==
rect.right,
"expected 0, got %d\n",
rect.right);
530 ok(0 ==
rect.top,
"expected 0, got %d\n",
rect.top);
531 ok(
rect.bottom,
"rect.bottom should not be 0\n");
532
536 {
537 win_skip(
"DrawTextW not implemented\n" );
538 }
539 else
540 {
542 ok(0 ==
rect.left,
"expected 0, got %d\n",
rect.left);
543 ok(0 ==
rect.right,
"expected 0, got %d\n",
rect.right);
544 ok(0 ==
rect.top,
"expected 0, got %d\n",
rect.top);
545 ok(
rect.bottom,
"rect.bottom should not be 0\n");
546 }
547
552 ok(textheight == heightcheck * 2,
"Got unexpected textheight %d, expected %d.\n",
553 textheight, heightcheck * 2);
556 ok(textheight >= heightcheck * 6,
"Got unexpected textheight %d, expected at least %d.\n",
557 textheight, heightcheck * 6);
558
563 ok(textheight == heightcheck * 2,
"Got unexpected textheight %d, expected %d.\n",
564 textheight, heightcheck * 2);
567 ok(textheight >= heightcheck * 6,
"Got unexpected textheight %d, expected at least %d.\n",
568 textheight, heightcheck * 6);
569
570
573 ok(textheight >= heightcheck,
"Got unexpected textheight %d\n", textheight);
574
576 memset(&dtp, 0,
sizeof(dtp));
579 ok(textheight >= heightcheck,
"Got unexpected textheight %d\n", textheight);
581
583 memset(&dtp, 0,
sizeof(dtp));
586 ok(textheight >= heightcheck,
"Got unexpected textheight %d\n", textheight);
590
592 memset(&dtp, 0,
sizeof(dtp));
596 ok(textheight >= heightcheck,
"Got unexpected textheight %d\n", textheight);
599
603
604
608
609
614}
static const char * wine_dbgstr_rect(const RECT *prc)
#define ERROR_CALL_NOT_IMPLEMENTED
static const WCHAR emptystringW[]
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
static const WCHAR textW[]
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
CHAR lfFaceName[LF_FACESIZE]
INT WINAPI DrawTextA(HDC hdc, LPCSTR str, INT count, LPRECT rect, UINT flags)
int WINAPI SetMapMode(_In_ HDC, _In_ int)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
#define CLIP_DEFAULT_PRECIS
#define DT_EXTERNALLEADING
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
int WINAPI DrawTextExA(_In_ HDC hdc, _Inout_updates_opt_(cchText) LPSTR lpchText, _In_ int cchText, _Inout_ LPRECT lprc, _In_ UINT format, _In_opt_ LPDRAWTEXTPARAMS lpdtp)
int WINAPI DrawTextExW(_In_ HDC hdc, _Inout_updates_opt_(cchText) LPWSTR lpchText, _In_ int cchText, _Inout_ LPRECT lprc, _In_ UINT format, _In_opt_ LPDRAWTEXTPARAMS lpdtp)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)